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

  1. sixfootjames
    Posted 2 years ago #


    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. Michael
    Forum Moderator
    Posted 2 years ago #

    consider to create a shortcode

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

Topic Closed

This topic has been closed to new replies.

About this Topic