Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #525760
    #527113

    Hey dialedinmarketing!

    What happens if you have multiple categories assigned to the post?

    Cheers!
    Elliott

    #527117

    I have this same request. If user clicks on the blog category in a menu, it shows the blog posts for that category so it would display the corresponding Category title above the posts. Doesn’t matter how many categories a blog post is in if the user is selecting by Category. Thanks.

    #527156

    Hi Elliot,

    There would not be multiple categories assigned to each post.

    Thanks!

    #527194

    Hi!

    No scarlet,
    if a post does have multiple categories, then there is a multiple selection and the post does shows all the categories included to it category array

    Best regards,
    Basilis

    #527198

    Not sure we’re understanding each other.

    If I have a post category named ‘Dogs’ and I have a second post category ‘Cats’, and I click on a link to the Dogs category, the url is “www.site.com/category/dogs/”, and if I click on a link for the Cats category, the url is “www.site.com/category/cats/” . Is there no way to pick up and display the specific category title, so the Dogs post archive page displays “Dogs” above the list of posts and the Cats post archive page displays “Cats”, so the user knows where they are.

    #527841

    Hi!

    Back to your original question, please edit the includes > loop-index.php file, look for this code around line 205:

    echo $title;
    

    .. replace it with:

    $categories = get_the_category();
    				echo '<span class="title-cat">' . $categories[0]->name . ': </span>' . $title;
    

    This will render the post category before the post title. Use the Quick CSS field to adjust the style of the element.

    Regards,
    Ismael

    #527857

    Unfortunately that doesn’t work. Please see in the link attached. Click on any news category in the sidebar menu. The first category seems to be placing the correct category name above the post title, but none of the other categories work. The requirement is to have the selected category displaying as the title on the post archive page for that category.

    Also included is a link to a graphic that shows what I am looking for with the category title as the page title.

    Thanks.

    #528737

    Hi Ismael,

    Same thing here. The code did not work.

    #530076

    Hi!

    Hmm.. It works on my installation. Please post the login details here, we’ll add it for you.

    @scarlett8: Please create a new thread, post the url to the website and your login details. Thanks.

    Regards,
    Ismael

    #530388

    I’ve checked all of my other WP themes, and they all put the post category title at the top of the page when the category is selected. Putting the post category above the post title in the list on the archive/category page is not a solution. I submitted a graphic of the requirement. Can you respond to that please. Thank you.

    #530544

    Hey!

    @scarlettr8: I just realized that your request is quite different from the original thread. The OP wanted to add the category next to the post title in the single post page, not the archive page. The code we provided above should work for that. I also thought that you’re the OP of this thread. Please create your own thread then we’ll check the issue there. You can start by modifying the archive.php file. Add this code above the post loop:

    echo avia_which_archive();
    

    @dialedinmarketing: Sorry about that. I thought you just jumped in in this thread. Please post the login details here then we’ll modify the file for you.

    Regards,
    Ismael

    #965583

    Hi!

    I have the same request: how to add the category above the title of a single post, like it is shown in the overview – the blog posts grid (see grid in https://www.allesraum.at/).

    I have added in this post – https://www.allesraum.at/wohnraeume-planen-beispiele/ – a title above the actual post title, just to make sure you know what I mean…

    I am using an enfold child theme and I can´t find the includes > loop-index.php file like Ismael is suggestig above… The folder structure of my child theme looks quite different than the parent.

    Thanks a lot in advance!
    Vesna

    #965763

    Hi,
    @Vesna Please open a new thread so we can assist, and include your admin login in the Private Content area, but as this is not your thread your login info will not be private.

    Best regards,
    Mike

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

You must be logged in to reply to this topic.