WordPress.org

Support

Support » How-To and Troubleshooting » How to add shortcode to the recent posts page

How to add shortcode to the recent posts page

  • I’m completely new to wordpress and floundering slightly so would appreciate some help.

    I have a plugin called Formspring which creates a simple question box. It comes with shortcode that works fine on a random ‘page’ (p=2) but I want it to appear at the top of the ‘recent posts’ page (p=1) which doesn’t list in my available pages in Dashboard > Pages. (Is this making sense?)

    Can anyone tell me how to get shortcode into the recent posts page?

    with thanks

    Jem Cook

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    @esmi

    Forum Moderator

    Try editing your theme’s index.php template file.

    Thanks Esmi, I tried dropping the shortcode direct into the index.php template and into the page.php template but it doesn’t parse the shortcode, just prints it out

    Any other ideas out there?

    jem

    esmi

    @esmi

    Forum Moderator

    Just released – your home page is an archive (post listings) page. Shortcodes are normally parsed by the_content filter, so they have to be added to the content of a specific page or post. What you could so is try looking for the function that the shortcode calls and see if you can call that in your index.php template.

    Thanks Esmi, I’ll give it a go, though I’m not sure my php skills are up to it – I’ll keep you posted!

    cheers

    Jem

    Michael

    @alchymyth

    Forum Moderator

    Thank you alchymyth, that was exactly what I was looking for and it worked perfectly!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add shortcode to the recent posts page’ is closed to new replies.
Skip to toolbar