• I’m trying to write a plugin that makes use of shortcodes, and that seems to work okay I’m simply using:

    
    add_shortcode('allan', function() {
      return 'ALLAN';
    });
    

    To test, I’ve been using the Docker WordPress image (currently 6.0.1). Everything default with my plugin installed and the shortcode registered.

    Editing the default post and going to http://localhost/2022/08/10/hello-world/ the shortcode renders out perfectly.

    On the index page however, I’ve found that:

    • Theme – Twenty Twenty Two: Doesn’t render at all
    • Theme – Twenty Twenty One: Doesn’t render at all
    • Theme – Twenty Twenty: Does render correctly

    Is there any way to get the default themes to render shortcodes in their index pages?

    I got utterly confused by this and it took me a good while to figure out what was going on, and I can only imagine non-techies would be even more frustrated.

    • This topic was modified 3 years, 7 months ago by t-p. Reason: Moved to Fixing WordPress from Developing with WordPress
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Homepage shortcode’ is closed to new replies.