Swap intro_title from blog/page title to category title

resolved (4 posts) (2 voices)

  1. chipbrogden
    Member

    I'm currently using the Intro with Title that displays the title of the page or post. I would like to have the intro title for posts display the category of the post instead of the name of the post (e.g., ARTICLES in the intro; the post title is displayed in the content below). I have a few hundred posts and I don't care to manually change the intro_title on all of them. I assume this is an easy swap of code from $post_title to category in functions.php, but that's where I need a little help?

    Thanks in advance!

    Posted 4 years ago #
  2. Elliott
    Support

    Hello chipbrogden,

    You can find this around line 1077 in,

    /wp-content/themes/[your_theme]/lib/functions/theme.php
    Posted 4 years ago #
  3. chipbrogden
    Member

    Found the spot... need a little help with what to put in there!

    So is it...

    single_cat_title('',false)

    ...replaces...

    get_the_title( $post->ID )

    ...starting around line 1001?

    Posted 4 years ago #
  4. Elliott
    Support

    Yes, single_cat_title() will grab one of the category names, http://codex.wordpress.org/Function_Reference/single_cat_title.

    Posted 4 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme