Multiple Post Snippets in one page
-
Hi,
I’m new to Post Snippets but I got one up and working beautifully, using PHP to load some information from an outside API.
Next, I realized I wanted to display the same information twice on my page. A summary form near the top and a longer display later. Rather than duplicate the code, I thought I’d incorporate the same Post Snippet in both places, with a variable called
display_type
to let it know which format to print in each place. When I tried to save my page with this, WordPress broke entirely (displayed a blank page instead of the Editor screen).I tried everything I could think of, but I can’t find a way around it. I even tried making a second copy of my PostSnippet with identical code but a different name and different variable names. Surely the two versions won’t interfere with each other in that case—but alas, if I try to save the page it breaks horribly and WordPress gives me a blank screen where I should see the Editor.
[MyPostSnippet source=”url” display_type=”small”]
[MyPostSnippet2 source_2=”url” display_type_2=”verbose”]I’m really not sure what to do. Is it true that only one Post Snippet can be included on any WordPress page, and it can only be included once? Or is there some trick I’m not seeing?
- The topic ‘Multiple Post Snippets in one page’ is closed to new replies.