- This topic has 25 replies, 4 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
October 27, 2020 at 7:28 pm #1507144
Tom
Lead DeveloperLead DeveloperSo the CSS in that topic is targeting an element like this:
<div class="entry-meta cat-links"> ...However, that’s not our default structure, it should look like this:
<div class="entry-meta"> <span class="cat-links"> ...So, the CSS from that topic never should have worked in the first place unless you had altered the HTML structure.
If you’re not sure how the HTML was altered, you can change all instances of this in your CSS:
.entry-meta.cat-linksTo this:
.entry-meta .cat-linksOctober 31, 2020 at 12:02 pm #1512753Rohan Verma
It seems that the category meta is already showing at the bottom of the article in the custom look instead of the default look.
Pushing that at the top and restoring the default category meta at the bottom is required.
Screenshot: https://prnt.sc/vaumkt
November 1, 2020 at 12:18 pm #1513721Tom
Lead DeveloperLead DeveloperOk, so to confirm:
1. You want the list of categories with the custom look to be above your title on single posts.
2. You also want the list of categories with the default look to be in the footer of your single posts.Were you accomplishing this before updating to 3.0? If so, how? The topic you linked to didn’t have any code that would move the categories away from their default location.
November 6, 2020 at 8:29 am #1520736Rohan Verma
Yes.
November 6, 2020 at 12:55 pm #1521040Tom
Lead DeveloperLead DeveloperHow were you doing this previously? I want to make sure the code we provide doesn’t conflict with what’s already there.
November 10, 2020 at 9:36 am #1525696Rohan Verma
November 10, 2020 at 1:51 pm #1525934Tom
Lead DeveloperLead DeveloperThere is no code in that topic that would move the categories above your post title. It only has CSS for styling the category items.
To add categories above the title, we could try this:
add_action( 'generate_before_entry_title', function() { if ( is_single() ) { echo '<div class="entry-meta">'; generate_do_post_meta_item( 'categories' ); echo '</div>'; } } );Does that do the trick?
November 13, 2020 at 9:57 am #1530219Rohan Verma
Yes it does.
But the box format isn’t there like before. Can you suggest just like this one: https://generatepress.com/forums/topic/look-of-single-post-category/
November 13, 2020 at 7:51 pm #1530578Tom
Lead DeveloperLead DeveloperCan you try the updated code?: https://generatepress.com/forums/topic/single-post-custom-category-meta-not-showing-after-update/page/2/#post-1525934
December 8, 2020 at 6:58 am #1571721Rohan Verma
Yes. Now, looks fine.
But the same meta is also appearing at the bottom of the article along with the default meta. How to remove the bottom one?
December 8, 2020 at 9:48 am #1571882Leo
StaffCustomer SupportCan you try unchecking the option in the customizer first?
https://docs.generatepress.com/article/blog-content-layout/#singleLet me know if it somehow removed both 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.