Support » Plugin: postTabs » tabs break when using apply_filters()

  • Resolved donnytree



    I am trying to display a page with tabs on a custom page template. In order to do this I am using the code:

    $post = get_post($id);
    $content = apply_filters('the_content', $post->post_content);
    echo $content;

    But this seems to be breaking the tabbed content coding and the first tab content displays, but the other tabs are blank. I tried using:

    $filtered = str_replace(array('<p>','</p>'), '', $post->post_content);

    based on another thread I found, and this gives me all the content but then the shortcode doesn’t render to produce the tabs.

    The html code all looks the exact same to me on my custom page template vs. regular page template, and I am not seeing any js errors.

    Any help would be appreciated, thank you in advance,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter donnytree


    I also tried just using <?php echo the_content(); ?> and only the first tab content is displayed. I can click the other tabs, but nothing displays. Any ideas?

    Thread Starter donnytree


    OK one more bit of info in case it’s helpful. If I view the source of the page, all of the content is there. For some reason when using the_content(); instead of the tabs being in there own divs, they are getting nested within the same div, e.g., on working site:

    <ul id="postTabs_ul_11518" class="postTabs" style="display:none">
    <div id="postTabs_0_11518" class="postTabs_divs postTabs_curr_div" style="display: none;">
    <div id="postTabs_1_11518" class="postTabs_divs" style="display: block;">
    <div id="postTabs_2_11518" class="postTabs_divs" style="display: none;">
    <div id="postTabs_3_11518" class="postTabs_divs" style="display: none;">
    <div id="postTabs_4_11518" class="postTabs_divs" style="display: none;">

    On not working site:

    <ul id="postTabs_ul_31340" class="postTabs" style="display:none">
    <div id="postTabs_0_31340" class="postTabs_divs postTabs_curr_div" style="display: block;">

    And the rest of the content is completely messed up and nested under that first div tag. Not sure if this makes sense.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘tabs break when using apply_filters()’ is closed to new replies.