• Amanda

    (@aevanswriting)


    Hello,

    I have a code snippet for displaying the last updated date on posts, but I’m not sure which php theme file to insert it into for Penscratch 2.

    The article below mentions one spot, but following the instructions results in the last updated date being shown on both posts AND pages. However, I only want it to appear on posts and am not 100% positive on which theme file to add it to for Penscratch 2.

    The code snippet is from a WP Beginner’s article about using it.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there!

    We’re not really able to help with custom code – you may ask at WP Beginner to be sure.
    In general, we do not recommend altering the theme’s code – you can either create a child theme or use a plugin like Code Snippets to add bits of code:
    https://www.ads-software.com/plugins/code-snippets/

    Thread Starter Amanda

    (@aevanswriting)

    I’m actually asking here because WP Beginning said it best to ask the author of the theme about the best file to put the code in for displaying the last updated/modified date on posts only. I’d also rather not have to use the plugin.

    I could just backup my files and then do trial and error on this, but I don’t know 100% for certain which file to try so I rather get input from the makers of the theme which is why I’m here (note: since WordPress.com made it, I already tried their forum and they sent me here.)

    Two things I was wondering in inserting it are:

    1) Is there perhaps something I can add to the code to tell it to only apply this date on posts and their meta data?

    2) Or, I was wondering if adding it to whatever the file is that tells posts what info to include (e.g. title, date published, category, tag, etc.) would do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying Date Last Updated on Posts Only?’ is closed to new replies.