Question

I wrote a shortcode for wordpress to display wordpress posts and pages. Displaying posts is fine but when I try to display pages, it goes on infinitely. I guess one of the pages contains the shortcode and hence it displays recursively. Can anyone suggest me the solution for this. As to how I can prevent short code from being executed while displaying ?

Was it helpful?

Solution

not totally sure if I understand correctly. Maybe you just need to have the shortcode run not from a page but in a template php file.

http://codex.wordpress.org/Function_Reference/do_shortcode

otherwise you will need to exclude that page from being displayed in your shortcode manually, is it a plugin you are working with?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top