Tag Info

Hot answers tagged

6

I guess you have: the_content(); wp_link_pages(); in your theme file. So you can instead try the following (PHP 5.4+): /** * Append the wp_link_pages to the content. */ ! is_admin() && add_filter( 'the_content', function( $content ) { if( in_the_loop() ) { $args = [ 'echo' => false ]; // <-- Adjust the arguments ...


1

You may not need to pass in the_post(). Calling the_post() sets up the global $post object, and get_field() may also be accessing the global $post object


1

You are correct that this is ineffecient, and there isn't really much you can do about it. I think the only other way to do this may be is with a very large (also ineffecient ) custom SQL query which unfortuantely I cannot help you with. If you have like 10 or 20 terms, the impact will not be that big, but if you have more, the effect can get very ...



Only top voted, non community-wiki answers of a minimum length are eligible