WordPress.org

Ready to get started?Download WordPress

Forums

How to add a function to the_content() to pull content from a post (2 posts)

  1. sixfootjames
    Member
    Posted 11 months ago #

    Hi,

    I have a layout issue that I could probably fix with jQuery but I wanted to find out if it is possible to do this using the_content() and a function in WordPress?

    the_content() Is looping over the content I need to extract, that's great, but how can I embed additional content within that loop? So basically it would look something like this:

    the_content ()
    Dapibus dolor nascetur magna elementum elementum, enim natoque, etiam est, velit scelerisque aliquet, penatibus! Nascetur cursus ac elementum.

    content from another post
    Et risus, placerat penatibus urna cum, augue tempor! Quis ridiculus, eros cum porta tempor rhoncus dolor sit elementum! Habitasse ultricies penatibus, ac ultrices, odio arcu tortor augue! Vut odio porta! Porttitor hac? Ultricies dignissim, montes tempor montes aenean tristique rhoncus non velit? In hac enim, ultrices, pellentesque montes, odio montes augue, pellentesque, mattis?

    the_content() - continued
    Augue lundium lectus lundium, mauris porttitor sit! Amet purus! Turpis augue sit elit, porta, et turpis integer, eu odio. Mattis risus odio risus! Rhoncus mauris, lundium nisi turpis placerat, sit et tincidunt dignissim! Ac, enim nisi penatibus! Scelerisque duis, magna lundium, platea ac odio, turpis integer magna odio! Ac.

    Thank you.

  2. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    consider to create a shortcode
    http://codex.wordpress.org/Shortcode_API

    or possibly search the plugins for some existing functionality; http://wordpress.org/plugins/search.php?q=post+in+post

Reply

You must log in to post.

About this Topic