Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This is a theme/wp issue.

    The template that creates the home page uses the php function the_excerpt();, while the template that shows the post uses the_post(); to display the post content.

    the_excerpt() shows a part of the post only, and does not process shortcodes like the_post() does.

    See:

    An auto-generated excerpt will also have all shortcodes and tags removed.

    on https://codex.wordpress.org/Template_Tags/the_excerpt

    To fix this:
    Use a different theme or modify your theme to use the_post() in stead of the_excerpt() on the front page.

    Thread Starter tracsoft

    (@tracsoft)

    Thank you for the response. That explains a lot. This is a theme I built with the help of a theme building program so not quite sure how to change it. is it as simple as replacing the function “the_excerpt();,” with “the_post();” and if so what file would I find this in?

    Again, thanks for the help. I am new to building themes and am trying to get away from using pre-made themes.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Yes, replace “the_excerpt();,” with “the_post();“. This will however show the full posts, not only the first part i.e. the excerpt. ( But you can use the ‘more’ option )

    Fils is most likely ( i can see much but not all… ) home.php or front-page.php
    See also: https://developer.wordpress.org/files/2014/10/wp-template-hierarchy-1024×640.jpg

    PS If the template uses get_the_excerpt(), replace it by get_the_post().

    Thread Starter tracsoft

    (@tracsoft)

    Thanks for all the help. Found another workaround for the problems. I went into the Functions file and removed the references to removing “shortcode” and that worked just like I wanted it to.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using shortcode in posts.’ is closed to new replies.