Support » Fixing WordPress » grabbing full posts when the page has a more section

  • Resolved dcarmo

    (@dcarmo)


    hello!

    I am trying to get the full post of a blog when it has a more section on it. So I have a post in my blog that has a ‘click here for more section’, and I am trying to grab the whole post even with this section on the page.

    I am using get_the_content() but it seems to only grab the post up until this more tag. Is there a special setting I need to use to get the full post past the get_the_content() section?

    Thanks,
    Carmo

Viewing 2 replies - 1 through 2 (of 2 total)
  • Use:

    global $more;    // Declare global $more (before the loop).
    $more = 1;       // Set (inside the loop) to display all content, including text below more.
    the_content();

    instead of get_the_content();

    get_the_content will put it into a variable, so $text = get_the_content(); is the correct usage. If this is what you are after, then $more still applies.

    Have a look at the the_content() in the codex

    Awesome that perfect! just what I was looking for 😀 and it works fine with get_the_content() which is the method that I am using and needed to use to store the info.

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘grabbing full posts when the page has a more section’ is closed to new replies.