WordPress.org

Ready to get started?Download WordPress

Forums

TPG Get Posts
[resolved] Added an extra P tag between title and content? (3 posts)

  1. Sam
    Member
    Posted 1 year ago #

    I just upgraded TGP to the latest version. And now there's an extra <p></p> in the code between the byline and the content. How do I get rid of it?

    This is what my page tag looks like:
    [tpg_get_posts fields="post_title, post_content" numberposts="3" show_entire="false" shorten_content="w400" show_meta="false" more_link_text="Read More."]

    And this is what the code outputs for an individual item:

    <div class="tpg-get-posts-post">
      <h2 class="tpg-title-class">Le Title</h2>
      <p class="tpg-byline-class">By Author Name on Dec 1, 2012</p>
      <p></p>
      <div class="tpg-content-class tpg-post-content">
        <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et...
        <a href="#">Read More.</a>
        </p>
      </div>
    </div>

    See that extra tag in the middle? How do I get rid of it?

  2. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Sam:

    I will correct this in a release within the next week - Depending on other activities. But for now, a quick fix is:

    Go to the plugin and select edit
    select the file tpg-get-posts/inc/class-tpg-gp-process.php from the right hand menu

    scroll down until you find the function format_byline($post) it is near the bottom
    find the line

    $_byline .= '</p>';
    $return $_byline;

    and change to

    //$_byline .= '</p>';
    $return $_byline;

    this is a temp fix until and the next update will have this resolved.

    If you are uncomfortable with editing the file, give me your email address and I will send you the module and you can ftp it to your site.

  3. Sam
    Member
    Posted 1 year ago #

    Sweet! That was easy enough. I made the change and it looks like it should.

    Thank you for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.