[Resolved] Shortcode show updated date in Pages

Home Forums Support [Resolved] Shortcode show updated date in Pages

Home Forums Support Shortcode show updated date in Pages

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1181421
    Eduard

    Hello,

    I’ve created a hook (after_entry_header) to display some info below the title of a page with:

    <p><em><a href="#author-id">Irene Gil Ortiz</a> • Actualizado:[modified_date] • <a class="cat-button" href=/#>CATEGORIA</a></em></p>
    

    I’ve used the [modified_date] prior inserting in my child functions.php theme the code as it is said in this documentation.
    The problem is that this shortcode seems not to be working in the Hook (despite I am activating the execute PHP option).

    It is currently showing like this in the rendered page Image example.

    ps. note that I want everything to display in plain text, that’s why I opted for this shortcode solution in order to avoid links to the “author” or the “date”.

    Any clues on how to proceed?
    Thank you so much in advance!

    #1181535
    Eduard

    Any help? =)

    #1181585
    Leo
    Staff
    Customer Support

    Hi there,

    I’m guessing that the get_the_modified_date() function only works in posts and not pages.

    Can you test if the shortcode work in posts?

    Let me know 🙂

    #1181657
    Eduard

    Hi Leo,
    it definetly works in posts. But I guess that it does in pages too (I have another website with a custome header for pages and it is working there).

    I think the problem comes from using a hook and not a custom header maybe?

    Is there any “easy” fix for that? I’d rather introduce the modified date by hand if not.

    Thank you.

    #1181730
    Leo
    Staff
    Customer Support

    Just to make sure, you’ve checked Execute Shortcodes (NOT execute PHP)? option in the hook element?

    #1182436
    Eduard

    :facepalm: ups. The newbie mistake.. damn it!

    Thank you so much Leo for the insight, feeling kinda stupid now ^^’.

    #1182439
    Leo
    Staff
    Customer Support
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.