WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code for posts
[resolved] Snippet being rendered outside column shortcode (5 posts)

  1. zimbo000
    Member
    Posted 6 months ago #

    Here is the code I use on home page:

    [one_third_last]
    <h5 class="homepage">Other Recent News</h5>
    [blog_list thumb="small" showposts="3" category_in= "46" disable="content,meta,more"]
    [random_posts title="Did you read these stories?" quantity_of_posts="2" Style_sra="3" AutoUpdate="1" Updating_Time="5"]
    <h5 class="homepage">Recent Comments</h5>
    [php snippet=3]
    [/one_third_last]

    Here is my snippet:
    <?php if(function_exists('jme_display_comments')) { jme_display_comments( array( 1 => 1, 2 => 40, 9 => 1, 3 => '<h3><a href="%PERMALINK%">%POSTTITLE%</a></h3>"%COMMENT%..."'));} ?>

    It works, but here is the HTML output:

    <div class="one_third last">
    <h5 class="homepage">Other Recent News</h5>
    <ul class="post_list small_post_list">
    <div class="widget spider_random_article">
    <script type="text/javascript">
    <div id="randarticle_0" style="">
    </div>
    <h5 class="homepage">Recent Comments</h5>
    <ul class="customized-recent-comments">
    <li class="recentcomment">
    </ul>

    The homepage code has [php snippet=3] inside the [one_third] column tags but the HTML is rendered with the snippet appearing outside/after the closing <div> of the column.

    Any idea why - and how can I fix it? If you want to view the page it's here: dev.henleyherald.com - you can see how the snippet should be lined up in the right hand third column but is wrapping across the whole screen.

    http://wordpress.org/plugins/php-code-for-posts/

  2. The.Missing.Code
    Member
    Plugin Author

    Posted 6 months ago #

    Hi zimbo000

    I'm not sure if this has been solved, or if you have used a different solution, but it appears to be working fine now.

    There is no reason that the snippet HTML should be rendered in the incorrect place, as the output from the snippet is returned to the shortcode location.

  3. zimbo000
    Member
    Posted 6 months ago #

    It is not solved. Please visit this page I referenced above (http://dev.henleyherald.com/) where if you use Firebug to view the HTML you will see the snippet is rendered outside of the [one_third} shortcodes.

  4. The.Missing.Code
    Member
    Plugin Author

    Posted 6 months ago #

    Hi Zimbo,

    I looked into the your html some more, and it would appear a random </div> tag has been placed in your code, which is causing the container to close early, forcing it to break out.

    There certainly is no reason for the plugin to modify the html in the manner that it is happening.

    TMC

  5. zimbo000
    Member
    Posted 6 months ago #

    @TMC

    Many thanks for your time & assistance - I found the problem. I had modified another plugin and used the wrong closing tag. Now fixed. Sent you something for your trouble.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.