• Resolved paulfitzwordpress

    (@paulfitzwordpress)


    Hi,

    Given the template I am using, I have to retrieve additional text content using the following PHP code in index.php

    <?php
    $id = 98;
    $p = get_post($id);
    $output = apply_filters(‘the_content’, $p->post_content);
    echo $output;
    ?>

    However, eztoc isn’t working. It ignores the shortcode also. I have double checked the settings, tried auto-inserting, tried leaving everything default.

    I suspect the problem relates to the way I inserting this content. Any ideas?

    The page I need help with: [log in to see the link]

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

    (@paulfitzwordpress)

    I added a shortcode for another plugin (https://getaawp.com/) to the page and it has all of its functionality. So I am thinking that the way easy TOC loads prevents it from working on pages included this way.

    Steven

    (@shazahm1hotmailcom)

    @paulfitzwordpress

    It likely is not passing the the eligibility test because the function that performs it uses the global post query var. My guess is that the eligibility test is being formed on the page and not the post content your are retrieving via get_post(). If I had to venture a guess, if you get the post content by setting up a new post query it would work Look up tutorials on how to do multiple loops. Now, I am just guessing, so, that could be a wild goose chase.

    Hope this helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_post and running ez-toc’ is closed to new replies.