1) The shortcode is not rendering, so I only see [the shortcode…]
2) If I’m in a section page the html added in generate_after_main_content hook appears without paddings or margins, but in a non section page it appears with paddings or margins.
If you see the text rendering out, kind of sounds like you are simply outputing them as HTML. Are you sure you are doing this?
<?php
do_shortcode("[the short code]");
?>
As for your second question, I personally don’t use Sections, but it sounds reasonable to me: if you are using sections for a page, and you are adding custom content to it via hook, you should be writing your markup for the added content as well.
Hello.
Zesen, you’re right! I was outputting as html so using the do_shortcode function do the trick.
Now I must adjust my div to looks like, for example, the Uw Bigdraje page.
Please, take a look at http://duitslanddag.sjbdixital.net/
Hi Leo.
I want to show the sponsoren div in all pages as it’s showed in Uw Bijdrage, Impressie and Aanmelden pages, not like it’s showed in Home, Programma, Sprekers, Standhouders and Niews pages.
I’ve used the sections add-on in this last ones (not in the other three pages).
What can I do to show all the pages in the same way?
Just to elaborate a bit more on Leo’s response, if the sponsoren div is generated by the shortcode, then I guess you would need to wrap it inside like this:
Hi Leo and Zesen.
Mmmm almost right.
The only problem is in pages with sidebars: for example in Nieuws or in a single standhouder page.
So I’ve tried with generate_before_content hook and it seems to work fine.
Do you also think this is the best approach?