I am trying to hook a CSS class to a element in PHP.
The issue that I am trying to fix is on the calendar page (can be found here) caption tag containing the month of the year i.e. January which is covering the days of the week (hiding them from view). How do I hook a class or ID to a PHP element?
I would like to hook a CSS class to the PHP code:
// day names array
// do not modify keys (Sunday-Saturday)
// modify values as needed, e.g. set "Sunday" to "Sun"
$day_names = array("Sunday" => "Sunday", "Monday" => "Monday", "Tuesday" => "Tuesday", "Wednesday" => "Wednesday", "Thursday" => "Thursday", "Friday" => "Friday", "Saturday" => "Saturday");
to give the days of the week margins and maybe a defind height to bump it down from the caption (month of the year calendar banner) tag above
the PHP in it's entirty can be found here: calendar.php_code.txt
the HTML output can be found at: monaghan2690.com/calendar/
There's no such thing as a "php element". Assuming you're dumping out the weekday headers in a loop, then
foreach($day_names as $day) {
echo '<div class="dayname">', $day, '</div>';
}
is all that's required.
Loop through the elements in your array. As you do, you build the HTML and have the array element in the HTML. Make sure the CSS class or id is a part of your HTML string inside your array loop.