WordPress.org

Ready to get started?Download WordPress

Forums

Toolbox
Add category name to Toolbox post header / entry-meta (5 posts)

  1. Ottens
    Member
    Posted 2 years ago #

    How do I add a single post's category to the header in the Toolbox theme?

    What it says now:

    Posted on January 21, 2012 by Nick Ottens

    What I'd like it to say:

    Posted on January 21, 2012 in Politics by Nick Ottens

    This is the code from the functions.php:

    function toolbox_posted_on() {
    	printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'toolbox' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'toolbox' ), get_the_author() ) ),
    		esc_html( get_the_author() )
    	);
    }

    http://wordpress.org/extend/plugins/toolbox/

    http://wordpress.org/extend/themes/toolbox/

  2. Ottens
    Member
    Posted 2 years ago #

    *Bump*

    Anyone thoughts?

  3. bradgillap
    Member
    Posted 1 year ago #

    I'm looking for this as well.

  4. bradgillap
    Member
    Posted 1 year ago #

    I got it in kind of a round about way using wordpress built in functions rather than toolbox.

    Look at content.php and find the first entry-meta div

    <div class="entry-meta">
    			<?php toolbox_posted_on(); ?>

    To get the categories you can add this to the line.

    <div class="entry-meta">
    			<?php toolbox_posted_on(); ?>
    			from category <?php the_category(', '); ?>
    		</div><!-- .entry-meta -->
  5. bradgillap
    Member
    Posted 1 year ago #

    to add the authors name you can just tack in

    <?php the_author() ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags