- This topic has 17 replies, 3 voices, and was last updated 3 years, 2 months ago by Tom.
-
AuthorPosts
-
January 10, 2021 at 1:28 am #1612811Atefan
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?January 10, 2021 at 4:56 am #1612938DavidStaffCustomer SupportHi 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 ?
January 10, 2021 at 5:14 am #1612955AtefanHi 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.January 10, 2021 at 11:36 am #1613480TomLead DeveloperLead DeveloperFor 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' );
January 10, 2021 at 11:56 pm #1613939AtefanHi Tom,
i installed the beta version and replaced
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
with yoursI do not see any difference to be true.
not on-page and not on this updated plugin, looks the same to me.January 11, 2021 at 3:28 am #1614102DavidStaffCustomer SupportI 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?
January 11, 2021 at 3:43 am #1614118AtefanHi 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.January 11, 2021 at 10:34 am #1614762TomLead DeveloperLead DeveloperHi there,
I just tried to load your site but it seems to be down. Can you check?
January 11, 2021 at 11:22 am #1614829Atefanit’s running on my end.
January 12, 2021 at 6:40 am #1615636AtefanTom,
have you been able?January 12, 2021 at 9:50 am #1616078TomLead DeveloperLead DeveloperLoading now. Can you re-add the date to the list so I can see why it’s not working?
January 12, 2021 at 10:04 am #1616093Atefanit has been ticked before and still now
https://pasteboard.co/JJkvFgz.pngJanuary 12, 2021 at 10:33 am #1616135Atefanor 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.
January 13, 2021 at 9:46 am #1617441TomLead DeveloperLead DeveloperYou 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.
January 13, 2021 at 10:49 am #1617522AtefanHi 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
-
AuthorPosts
- You must be logged in to reply to this topic.