[Resolved] Modified Date

Home Forums Support [Resolved] Modified Date

Home Forums Support Modified Date

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #131332
    Aamir

    Hey Tom,

    I worked on the free version first and then downloaded the premium…it works great.

    I was hoping you can help me with one thing, that I want my posts to show modified date and also for the search engines.

    My website is http://www.rjaamir.com and currently I have removed the dates. I have updated all the content so it seems justified.

    Thanks,
    Aamir

    #131340
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    So you want the modified date to show to humans, and you want to remove the published date?

    Currently it only shows the search engines, while the published date is shown to humans.

    Let me know ๐Ÿ™‚

    #131347
    Aamir

    Thanks for the prompt reply.

    Yes I want the modified date to be shown to both the humans and the search engine and not the published date.

    #131381
    Tom
    Lead Developer
    Lead Developer

    First, you’ll want to add this function: https://gist.github.com/generatepress/57ef8336f9afec9bb42a

    Then, you’ll want to add this CSS:

    .posted-on .updated {
        display: inline-block;
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
    Adding CSS: https://generatepress.com/knowledgebase/adding-css/

    #131466
    Aamir

    Thanks a lot ๐Ÿ™‚

    #131467
    Tom
    Lead Developer
    Lead Developer

    No problem! ๐Ÿ™‚

    #131475
    Aamir

    I did as you asked but now it shows both the published and modified date…as shown in the copy below:

    10 Hacks to become fluent in English
    August 17, 2015August 18, 2015 by RJ Aamir
    Answer by RJ Aamir: Iโ€™ll share my experience with you that how I became fluent in English: I have had an English medium schooling all through but at my school more emphasis was put on the written part of the language and not so much on the speaking ability. Plus the fact that at โ€ฆ Read moreโ€ฆ

    I am very new this so maybe I did something wrong

    #131476
    Aamir

    Ohhh…I did….its working now…

    Thanks anyway ๐Ÿ™‚

    #131477
    Tom
    Lead Developer
    Lead Developer

    Glad you got it working ๐Ÿ™‚

    #348282
    Myra Mings

    Hello, I followed these instructions and it worked (THANKS!). I do wonder…is there a way to add the prefix “last updated” to appear before the date?

    If that would not be a good thing to do for SEO reasons or what not I don’t have to have it. But if it doesn’t make any difference for SEO, I would like to include it. Any ideas?

    I’m afraid if I keep messing around with PHP without knowing exactly what I am doing, I am going to break my site, lol! I thought I better ask you!

    #348329
    Tom
    Lead Developer
    Lead Developer

    Hi Myra,

    Give this a shot:

    .posted-on .updated:before {
        content: "Last updated: ";
    }

    BTW, it looks like you’re still using the standalone add-ons. Shoot me an email and I’ll get you set up with GP Premium, as those standalone add-ons are no longer updated: https://generatepress.com/contact/

    #375230
    vemvem6

    I’m trying to get the modified date and it’s working, BUT I get also the posted date in same line “August 10, 2017August 29, 2017 by John”

    How can I remove the “August 10, 2017”?

    I put

    .entry-meta {
        display: none;
    }

    but then the entire tag disappears!

    #375545
    Leo
    Staff
    Customer Support

    Can you link me to the page? Thanks!

    #375690
    vemvem6

    Sure, here: http://bit.ly/2wHzuUp

    In my CSS I added:

    .posted-on .updated:before {
        content: "Last updated: ";
    }
    
    .posted-on .updated {
        display: inline-block;
    }
    

    In my PHP I added:

    add_action( 'generate_after_entry_header', 'tu_page_post_meta' );
    function tu_page_post_meta()
    {
    	if ( 'page' == get_post_type() ) : ?>
    		<div class="entry-meta">
    			<?php generate_posted_on(); ?>
    		</div><!-- .entry-meta -->
    	<?php endif;
    }

    The effect is:

    August 10, 2017Last updated:August 29, 2017

    As I mentioned in the other post, if I add an additional line of CSS code:

    .entry-meta {
        display: none;
    }

    then the entire text disappears…

    Help very much appreciated Leo! thank you in advance

    #375691
    Leo
    Staff
    Customer Support

    Try this instead:

    .entry-date {
        display: none;
    }
Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.