New div from new function not picking up css styling
-
I’m trying to develop a new function for my child theme (based on veryplaintxt). The function will add some graphics to the categories archive page, to float:right next to the category description and the post excerpts. The function seems to be working right, the right code shows up in the page source, but for some reason it’s not picking up the css styling for #category_art.
This is the function:
function category_art() { echo '<div id="category_art">'; echo "This is category_art div."; echo "</div> <!-- div#category_art -->"; }
The function seems to be working fine.
This is the css entry in style.css for my child theme:
/* styling for art work on the various category (topics) archive pages */ #category_art { margin:3px; padding:3px; float:right; height:300px; border: solid black 2px; }
This is where I’ve inserted the function in archive.php in my child theme:
<?php elseif ( is_category() ) : ?> <h2 class="page-title"><?php _e('Topic Archives:', 'veryplaintxt') ?> <span class="page-cat"><?php echo single_cat_title(); ?></span></h2> <?php category_art(); ?> <div class="archive-meta"><?php if ( !(''== category_description()) ) : echo apply_filters('archive_meta', category_description()); endif; ?></div> <?php elseif ( is_tag() ) : ?>
This is how the source code comes out when I visit the page:
<!--changed 'Category Archives' to 'Topic Archives' at 'elseif (is_category()'--> <div id="container"> <div id="content" class="hfeed"> <h2 class="page-title">Topic Archives: <span class="page-cat">the human person</span></h2> <div id="category_art">This is category_art div.</div> <!-- div#category_art -->
So WP is generating html that calls the styling for the div with ID #category_art, but it’s not showing the styling. All I get is a plain line of text “This is category_art div.” left-justified between the “Category Archives” heading and the category description.
When I inspect the element with Firebug all is shows is styling inherited from “body.”
What am I missing?
Thanks
wperic
- The topic ‘New div from new function not picking up css styling’ is closed to new replies.