[Resolved] i use “Only Show Updated Date”, but in “latest post” not showing

Home Forums Support [Resolved] i use “Only Show Updated Date”, but in “latest post” not showing

Home Forums Support i use “Only Show Updated Date”, but in “latest post” not showing

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1612811
    Atefan

    Hello,

    I used this, to show the latest update date on the post, works!
    first-line only, as time icon did not work
    https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
    but when I go to the index page to use the “Latest Post”, it shows only the Publishing date post and not the new update post.
    how can I archive this?

    #1612938
    David
    Staff
    Customer Support

    Hi there,

    are you using a shortcode to display the Post date on your index ? If so can you share the code you used to create the shortcode ?

    #1612955
    Atefan

    Hi David, I just added now WP Show Posts, with his shortcode option, for page and post.
    but removed date, as it shows than published date, not latest updated date. looks a bit wired.

    #1613480
    Tom
    Lead Developer
    Lead Developer

    For Show Posts, you can use the latest development version: https://wpshowposts.com/wp-show-posts-1-2-0/

    Then use this filter:

    add_filter( 'wpsp_post_date_show_updated_only', '__return_true' );

    #1613939
    Atefan

    Hi Tom,

    i installed the beta version and replaced
    add_filter( 'generate_post_date_show_updated_only', '__return_true' );
    with yours

    I do not see any difference to be true.
    not on-page and not on this updated plugin, looks the same to me.

    #1614102
    David
    Staff
    Customer Support

    I am only see WPSP in the footer widgets, the date at the top of page is not being output by WPSP its inside a GenerateBlocks Block – is that the date that requires changing?

    #1614118
    Atefan

    Hi David,
    On top it’s just a date stamp.

    What I’m looking for is the date stamp to the updated post and pages created by WPSP down.
    It pulls the updated post and pages, but no showing timestamp, as you see the big gap in between titles. It is blank.

    #1614762
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I just tried to load your site but it seems to be down. Can you check?

    #1614829
    Atefan

    it’s running on my end.

    #1615636
    Atefan

    Tom,
    have you been able?

    #1616078
    Tom
    Lead Developer
    Lead Developer

    Loading now. Can you re-add the date to the list so I can see why it’s not working?

    #1616093
    Atefan

    it has been ticked before and still now
    https://pasteboard.co/JJkvFgz.png

    #1616135
    Atefan

    or it have to do something with that:

    .home .entry-meta {
    display: none;
    }

    as I place this to remove the update in home.

    but even when I remove the code, it does not show up, only the page update shows again.

    #1617441
    Tom
    Lead Developer
    Lead Developer

    You have this CSS which is stopping it from showing up:

    .wp-show-posts-updated {
        display: none;
    }

    The date itself is the updated date (which is why that CSS is working), so the PHP is all working as it should.

    #1617522
    Atefan

    Hi Tom

    this is how my

    <--- sticky sidebar--->
    @media (min-width: 769px) {
     .site-content {
     display: flex;
     }
    .inside-right-sidebar {
     height: 100%;
     }
    .inside-right-sidebar aside:last-child {
     position: -webkit-sticky;
     position: sticky;
     top: 70px;
     }
     }
    <--- end sticky sidebar--->
    
    <--- start button--->
    .button.ghost, .button.ghost:visited {     
        background: transparent;     
        border: 2px solid #FBB93E; 
    } 
    .button.ghost:hover, 
    .button.ghost:active {     
        background: #FBB93E;     
        color: #222222;     
        border: 2px solid transparent; 
    }
    <--- end button--->
    <--- start site logo--->
    .site-logo img {
        width: 350px;
        height: 70px;
    }
    <--- end site logo--->
    <--- start h1 tag padding--->
    .single-post.full-width-content .entry-header,
    .single-post.full-width-content footer.entry-meta {
        max-width: 1200px;
        padding-left: 40px;
        padding-right: 40px;
        margin: auto;
    }
    .single-post.full-width-content footer.entry-meta {
        padding-bottom: 40px;
    }
    <--- end h1 tag padding--->
    <--- start next previous alignment--->
    .post-navigation {
    	display: flex;
    }
    
    .post-navigation .nav-next {
    	width: 50%;
    	text-align: right;
    	display: flex;
    	flex-direction: row-reverse;
    }
    
    .post-navigation .nav-previous {
    	width: 50%;
    }
    
    .nav-next .gp-icon {
    	margin-left: .6em;
    	margin-right: 0;
    }
    <--- end next previous alignment--->
    <--- start capcha hidden--->
    .grecaptcha-badge {visibility: hidden;}
    <--- endcapcha hidden--->
    <--- start hide date in frontpage--->
    .home .entry-meta {
        display: none;
    }
    <--- end start hide date in frontpage--->
    

    additional CSS looks like, I do not see your code there and not in PHP

    
    ?php
    /**
     * GeneratePress child theme functions and definitions.
     *
     * Add your custom PHP in this file.
     * Only edit this file if you have direct access to it on your server (to fix errors if they happen).
     */
    
    /**
     * updated date on post
     */
    add_filter( 'wpsp_post_date_show_updated_only', '__return_true' );
    
    /**
     * Page date to page 
     */
    add_action( 'generate_after_entry_header', 'tu_page_meta' );
    function tu_page_meta() {
        if ( is_singular( 'page' ) ) : ?>
            <div class="entry-meta">
                <?php generate_posted_on(); ?>
            </div><!-- .entry-meta -->
        <?php endif;
    }
    
    /**
     * Date to frontpage
     */
     add_shortcode( 'footer_date', 'lh_footer_date' );
    function lh_footer_date() {
        ob_start();
        echo date('d.m.Y');
        return ob_get_clean();
    }
    
    /**
     * remove website field in comments
     */
    add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
    function tu_add_comment_url_filter() {
        add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
    }
    
    function tu_disable_comment_url($fields) {
        unset($fields['url']);
        return $fields;
    }

    I use the child theme

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