Title is reset if further shortcodes used within that call wp_reset_postdata
-
adding an inner shortcode to a parallax section can in some cases override the title from the parallax section
patch follows to ensure the correct title is used
--- includes/adamrob-parralax-shortcode.php 2017-07-10 18:54:25.006600584 -0400 +++ includes/adamrob-parralax-shortcode.php 2017-07-10 18:49:39.203355268 -0400 @@ -260,13 +260,13 @@ //Build the title $output .= '<table style="width:100%; height:100%; border-style:none; margin:0;"><tr>'; $output .= '<td class="parallax-header" style="text-align:'.$hpos.'; vertical-align:'.$vpos.'; padding:'.$padding.'px; border-style:none;">'; - $output .= '<h2 id="parallax_'.$postid.'_posttitle" class="adamrob_parallax_posttitle" style="'.$hStyle.'">' . get_the_title() . '</h2>'; + $output .= '<h2 id="parallax_'.$postid.'_posttitle" class="adamrob_parallax_posttitle" style="'.$hStyle.'">' . get_the_title( $postid ) . '</h2>'; $output .= '</td></tr></table>'; }else{ //Build the title $output = $output . '<div id="parallax_'.$postid.'_posttitle" class="adamrob_parallax_posttitle" style="text-align:'.$hpos.'; padding:'.$padding.'px;">'; - $output = $output . '<h2 style="'.$hStyle.'">' . get_the_title() . '</h2>'; + $output = $output . '<h2 style="'.$hStyle.'">' . get_the_title( $postid ) . '</h2>'; $output = $output . '</div>'; //Build the content @@ -307,4 +307,4 @@ -?> \ No newline at end of file +?>
- The topic ‘Title is reset if further shortcodes used within that call wp_reset_postdata’ is closed to new replies.