- This topic has 20 replies, 3 voices, and was last updated 3 years, 5 months ago by Elvin.
-
AuthorPosts
-
November 2, 2020 at 6:37 pm #1515440Michelle
I am using Generate Press Premium along with your other plugin, WP Show Posts Pro.
I want my single post page (GeneratePress Premium) and my blog page meta (WP Show Posts Pro) to look like this:
by Michelle and Jordan Cook | August 23, 2020 | Thoughts
[link Color #b80000] [Color #000000] [link Color #b80000]How can I achieve this?
November 2, 2020 at 7:00 pm #1515450ElvinStaffCustomer SupportHi,
You can follow this article to style the single post page:
https://docs.generatepress.com/article/entry-meta-style/As for WP Show Posts, edit the post list you’re editing.
Under “Meta” tab, make sure
include author
,include date
andinclude terms
are checked. You then change theAuthor location
,Date Location
andTerms Location
dropdown value toBelow title
.As for styling them, you can try these CSS:
.author-name{color: #b80000;} .wp-show-posts-entry-date .published{color: #000000;} .wp-show-posts-terms .wp-show-posts-meta{color: #b80000;}
November 2, 2020 at 8:25 pm #1515493MichelleThank you for the Entry Meta Style Documentation and CSS. Does this CSS go into the Customize>Additional CSS?
There are still two things I am seeking to change:
1. I want the word “by” before the author meta, if possible. π
2. I would like the single post page and the blog page meta to match. (The documentation was for 3 examples of meta with code, all of which were nice looking, but none of them match my blog page meta).
November 2, 2020 at 8:30 pm #1515504ElvinStaffCustomer SupportDoes this CSS go into the Customize>Additional CSS? Also, I want the word βbyβ before the author meta, if possible. π
If you must add the ‘by’ string before the author name, you can add this pseudo element CSS:
.author-name:before{content:'by '; color: #b80000;}
Adding the color property is optional, incase you want it to have a different color.
November 2, 2020 at 8:45 pm #1515512MichelleThank you again. Does this CSS go into Settings>Additional CSS?
November 2, 2020 at 8:50 pm #1515514ElvinStaffCustomer SupportThank you again. Does this CSS go into Settings>Additional CSS?
Yes you can do that.
Or you can follow this documentation on how to add CSS. https://docs.generatepress.com/article/adding-css/
November 2, 2020 at 8:57 pm #1515517MichelleThe code worked for adding “by”. Thank you for that.
How do I make the date meta black (#000000)?
November 2, 2020 at 9:24 pm #1515542ElvinStaffCustomer SupportHow do I make the date meta black (#000000)?
if
.wp-show-posts-entry-date .published{color: #000000;}
from the previous reply didn’t work, try this one:time.wp-show-posts-entry-date.published { color: black; }
November 2, 2020 at 9:32 pm #1515555MichelleElvin? You are some kind of genius! I need your brain for coding.
How can I put this same code into the single post page?
November 2, 2020 at 10:02 pm #1515575ElvinStaffCustomer SupportHow can I put this same code into the single post page?
Add this PHP snippet to get the text display right.
add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'date', 'categories', ); } );
Here’s how to add PHP snippets: https://docs.generatepress.com/article/adding-php/
As for the date, use this CSS:
time.entry-date.published{ color: black; padding: 0 5px 0 5px; border-right: 2px solid black; border-left: 2px solid black; }
For the category links, use this CSS:
.cat-links a{ color: black; }
As for the author name. WPSP and the GP default uses the same CSS class selector so
.author-name{..}
should work for both.November 3, 2020 at 5:12 pm #1516992MichelleI just added an Element Hook with a php snippet:
add_filter( ‘generate_header_entry_meta_items’, function() {
return array(
‘author’,
‘date’,
‘categories’,
);
} );Hook: generate_after_entry_title
Checkmarked: Execute PHP
Priority 10
Display Rules: All Singular and All ArchivesWhat shows up, instead of meta under the title, is add_filter( ‘generate_header_entry_meta_items’, function() { return array( ‘author’, ‘date’, ‘categories’, ); } );
How do I fix this?
November 3, 2020 at 5:40 pm #1517011ElvinStaffCustomer SupportOh right,
I should mention that when you’re using the Hook Element, you must add
<?php ?>
syntax so the hook knows that its an PHP snippet.Here’s an example:
<?php add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'date', 'categories', ); } ); ?>
And hook it on your
wp_head
.November 3, 2020 at 9:14 pm #1517111MichelleThat worked, but with two caveats:
1. On the single post page, “by” now shows twice. (I added the “by” on the blog page because it was on the single post page.)
2. I’d like to reduce the padding between the title and meta on the single post page so it looks like the blog page.
November 4, 2020 at 10:00 am #1518046TomLead DeveloperLead DeveloperHi there,
I’m not able to log in using the URL you provided – it seems maybe the login URL has been changed?
Also, this function:
add_filter( 'generate_header_entry_meta_items', function() { return array( 'author', 'date', 'categories', ); } );
Should be added using one of these methods: https://docs.generatepress.com/article/adding-php/
Let us know π
November 4, 2020 at 10:24 am #1518071MichelleThanks Tom. Yes, I changed the login url (I attached the changes in the Private Information section)
-
AuthorPosts
- You must be logged in to reply to this topic.