Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2010
    Thanked 0 Times in 0 Posts

    Embed something after X number of lines

    I am using Wordpress and the Datafeedr Random Ads plugin. I want to be able to embed the code after say the first paragraph of a given post. Currently however the WP code is

    <?php the_content(); ?>

    This tells the page to show the content saved for that specific post, so I can only put it before or after the content and I want it in the middle.

    I have a fairly decent grasp on PHP so any help would be greatly appreciated.

    Thanks guys!

  2. #2
    Supreme Master coder!
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,167 Times in 1,158 Posts
    The answer to your problem will relate to "get_the_content()" ...


    I'm not sure how you will determine where the first paragraph ends,
    but once you "get_the_content", you can filter, format, or do things to it.

    Googling that might also get you more examples.

    Sorry I don't have the definitive answer for you.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts