• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Using short codes on 404 and search result pages

Messages
2
Likes
0
Points
1
#1
I am building custom 404 and search result pages and was trying to use a short code in the template files: "echo do_shortcode("[services-and-location]");". This works for all posts and pages, but it appears the shortcodes are not active for the 404 (404.php) and search result (search.php) template files. I assume something like add_filter( '?NAME?', 'do_shortcode' ); would probably do it, but I can't figure out what name to add it to. Does anyone know how to get the WoodySnippet shortcodes working on the 404 and search result pages?
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

I tried it myself - the shortcode worked on page 404.
Check the additional conditions of your snippet
 
Messages
2
Likes
0
Points
1
#3
Hello.

I tried it myself - the shortcode worked on page 404.
Check the additional conditions of your snippet
Thank you! That was it. I had checked all the settings but didn't pay attention to the default snippet-specific conditions (never used them before and glanced over them). After I changed it from 'all singulars' to 'entire website', it showed up.