Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13205

    I’m updating the Coherence theme and I’d like to have the post category name displayed at the top of individual post pages (below the menu bar) instead of “Blog” or “Blog – Latest News”.

    This will help my readers more quickly identify which section of the site they are in by showing the Category name at the top instead of “Blog” on every page.

    Even better if when a reader clicks on the category name at the top of a post page it links them back to the main category page for ALL of the posts in that category.

    Does anyone know where and how to change this?

    Thank you.

    #78253

    Hi bradpennock,

    I’ll put in the idea as a feature request with Kriesi and flag the thread for him to take a look at. From the looks of it, the header has the ability to have a subtitle but adding “the_category” would make the title out of place. It would look something like:

    Blog - Latest News
    posted in Category, Category, Category

    So the whole thing would need to re-done to be more like a breadcrumb navigation scheme.

    Regards,

    Devin

    #78254

    I found the following code on the WordPress Codex site that fixes the problem in the Coherence single.php file:

    <h2><?php $categories = get_the_category(); foreach($categories as $category) { $cat_name = $category->name; if($cat_name != ‘featured’) echo ‘term_id).’”>’.$cat_name . ‘ ‘; } ?></h2>

    SO I REPLACED THIS…

    <?php

    $title = __(‘Blog – Latest News’, ‘avia_framework’); //default blog title

    $t_link = ““.$title.”“;

    $t_sub = “”;

    if(avia_get_option(‘frontpage’) && $new = avia_get_option(‘blogpage’))

    {

    $title = get_the_title($new); //if the blog is attached to a page use this title

    $t_link = ““.$title.”“;

    $t_sub = avia_post_meta($new, ‘subtitle’);

    }

    echo avia_title($t_link, $t_sub);

    ?>

    WITH THIS…

    <?php

    $categories = get_the_category();

    foreach($categories as $category) { $cat_name = $category->name;

    if($cat_name != ‘featured’) $t_link = ‘term_id).’”>’.$cat_name . ‘ ‘; }

    $t_sub = “”;

    if(avia_get_option(‘frontpage’) && $new = avia_get_option(‘blogpage’))

    {

    $t_sub = avia_post_meta($new, ‘subtitle’);

    }

    echo avia_title($t_link, $t_sub);

    ?>

    #78255

    Hi,

    Glad that this was resolved and that you have shared the solution. :)

    Cheers,

    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Post category names at the top of posts instead of "Blog"’ is closed to new replies.