Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    31
    Thanks
    2
    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
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    The answer to your problem will relate to "get_the_content()" ...

    http://codex.wordpress.org/Function_...et_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
    •