• catalpha

    (@catalpha)


    How can I apply a class style to ‘twentyten_posted_in‘…

    I was able to apply a class to ‘posted_on’ because it all runs together. Not sure where to open/close tag and what tag to use. I used a <p class=”name”></p> to apply class to ‘posted_on’.

    Thank you,
    Charlie

Viewing 7 replies - 1 through 7 (of 7 total)
  • Chip Bennett

    (@chipbennett)

    From the “loop-single.php” template file:

    <div class="entry-utility">
    <?php twentyten_posted_in(); ?>
    <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
    </div>

    So, you want to target the entry-utility class.

    Thread Starter catalpha

    (@catalpha)

    I only see this… Should I wrap it all in a <div>?

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Chip Bennett

    (@chipbennett)

    Where do you see that code?

    Thread Starter catalpha

    (@catalpha)

    In loop.php.
    WordPress v3.1

    Chip Bennett

    (@chipbennett)

    Again, you want to target the entry-utility</code class. From loop.php:

    <div class="entry-utility">
    ...SNIP...
    	<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    ...SNIP...
    	<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    ...SNIP...
    </div><!-- .entry-utility -->

    Thread Starter catalpha

    (@catalpha)

    where is .entry-utility used?

    I view the page with firebug and I don’t see that any of content on the line has a <div> or class applied to it by WP.

    I did this in loop.php and it only works in index.php. No effect in single posts or categories.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Chip Bennett

    (@chipbennett)

    where is .entry-utility used?

    *sigh*
    Again, from loop.php:

    <div class="entry-utility">

    And again, from loop-single.php:

    <div class="entry-utility">

    All of the “Posted in” markup is inside of this DIV.

    If you want to target the “Posted in” container directly, note these classes:

    <span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) );

    That sprintf bit produces this:

    <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span>

    So, you can target either of the following classes:

    .entry-utility .entry-utility-prep {}
    .entry-utility . entry-utility-prep-cat-links {}

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Apply class style to functions.php in WP3.1’ is closed to new replies.