[Resolved] Single Post Page

Home Forums Support Single Post Page

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #1515440
    Michelle

    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?

    #1515450
    Elvin
    Customer Support

    Hi,

    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 and include terms are checked. You then change the Author location, Date Location and Terms Location dropdown value to Below 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;}

    A wise man once said:
    "Have you cleared your cache?"

    #1515493
    Michelle

    Thank 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).

    #1515504
    Elvin
    Customer Support

    Does 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.

    A wise man once said:
    "Have you cleared your cache?"

    #1515512
    Michelle

    Thank you again. Does this CSS go into Settings>Additional CSS?

    #1515514
    Elvin
    Customer Support

    Thank 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/

    A wise man once said:
    "Have you cleared your cache?"

    #1515517
    Michelle

    The code worked for adding “by”. Thank you for that.

    How do I make the date meta black (#000000)?

    #1515542
    Elvin
    Customer Support

    How 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;
    }

    A wise man once said:
    "Have you cleared your cache?"

    #1515555
    Michelle

    Elvin? You are some kind of genius! I need your brain for coding.

    How can I put this same code into the single post page?

    #1515575
    Elvin
    Customer Support

    How 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.

    A wise man once said:
    "Have you cleared your cache?"

    #1516992
    Michelle

    I 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 Archives

    What 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?

    #1517011
    Elvin
    Customer Support

    Oh 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.

    A wise man once said:
    "Have you cleared your cache?"

    #1517111
    Michelle

    That 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.

    #1518046
    Tom
    Lead Developer
    Lead Developer

    Hi 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 πŸ™‚

    #1518071
    Michelle

    Thanks Tom. Yes, I changed the login url (I attached the changes in the Private Information section)

Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.