Tagged: blog post
-
AuthorPosts
-
October 27, 2015 at 7:29 pm #525760
Hi Krisei team,
I was wondering if anyone could tell how to add a blog’s category before the blog category title so that the title is “Blog Post Category: Blog Post Title”
For example
My site currently has “Find God” as the blog post Title.
How can I make it say.. “Story of the Week: Find God” as the title. It would also be great if you could include how to remove the title as a link on the single post blog page. Since it would just lead back to same page the user is currently on.
Many thanks,
DImarketingOctober 29, 2015 at 8:19 pm #527113Hey dialedinmarketing!
What happens if you have multiple categories assigned to the post?
Cheers!
ElliottOctober 29, 2015 at 8:22 pm #527117I 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.
October 29, 2015 at 9:13 pm #527156Hi Elliot,
There would not be multiple categories assigned to each post.
Thanks!
October 29, 2015 at 10:47 pm #527194Hi!
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 arrayBest regards,
BasilisOctober 29, 2015 at 10:56 pm #527198Not 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.
October 31, 2015 at 5:05 am #527841Hi!
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,
IsmaelOctober 31, 2015 at 6:38 am #527857Unfortunately 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.
November 2, 2015 at 6:36 pm #528737Hi Ismael,
Same thing here. The code did not work.
November 4, 2015 at 3:31 pm #530076Hi!
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,
IsmaelNovember 4, 2015 at 8:03 pm #530388I’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.
November 5, 2015 at 7:20 am #530544Hey!
@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,
IsmaelJune 1, 2018 at 10:30 pm #965583Hi!
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!
VesnaJune 2, 2018 at 11:08 am #965763 -
AuthorPosts
- You must be logged in to reply to this topic.