Empty page content breaks template
I have a custom template that displays the page title, then the_content() then does some additional things (like displaying a list of all categories etc).
If there is no content entered for the page then the remainder of the template is not rendered. As soon as I add a bit of text to the page then everything works fine.
I believe the problem lies in the pin_it_buttons_add() and str_get_html() functions. In str_get_html() if $content is empty then the function returns false. That false return value is assigned to $html in pin_it_buttons_add() … at which point the $html->find() function won’t do anything and the $false value is returned instead of the original blank content.
- The topic ‘Empty page content breaks template’ is closed to new replies.