• I have a custom post type with an ID of 4, designated for global theme options. In the theme options I’ve got a custom field as wysiwyg for user to add the footer logos with default WP create gallery functionality. Code snippet WP generates for gallery below:

    $footer_logos =[gallery size="full" ids="8198,8199,8197"]

    It works great on all templates, except the 404.php

    I’ve filtered it with apply_filters(‘the_content’, $footer_logos ) — this will not display the gallery. If i have other content in the wysiwyg like paragraphs or single images, it does display all other wysiwyg content on the 404.php, EXCEPT the gallery shortcode. Also tried do_shortcode with the string (this didn’t work, and strangely only rendered 2 of the 3 images),

    I really like the WP default gallery, especially for this instance of footer logos and unforseen # of columns, but for the life of me I can’t get the gallery shortcode to render on the 404.php, so i’m considering other options. This feels like a WP core bug,

    I’d love it if WP can fix this in a next version! Or, if someone has knowledge as to why the shortcode won’t render on a 404.php, I’d love feedback. Thank you.

    • This topic was modified 9 years, 8 months ago by bansay.
    • This topic was modified 9 years, 8 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘cannot render gallery shortcode on 404.php’ is closed to new replies.