• Resolved ocpplus

    (@ocpplus)


    Hi All,

    Getting a headache on this one.

    This my site. I am trying to get the “more” section to display an excerpt, just like the “popular posts” section does. It is only showing blanks, but when looking at the page source code it shows the text is there. Theme is Technical Speech.

    The code for this area is:

    <div class=”contentbox”>
    <div class=”boxheading”><span>Most Popular</span><div class=”clear”></div><div class=”left”></div></div>
    <div class=”blockborder” id=”pop_border”>
    <?php popularPosts(); ?>
    <div class=”clear”></div>
    </div>
    </div>

    <div class=”contentbox”>
    <div class=”boxheading”><span>More</span><div class=”clear”></div><div class=”left”></div></div>
    <div class=”blockborder” id=”pop_border”>
    <?php
    $postslist = get_posts(‘numberposts=6&order=DSC&orderby=date’);
    foreach ($postslist as $post):
    setup_postdata($post);
    ?>

    <div class=”postblock”>
    <div class=”postblockwrap”>
    <h6>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h6>


    class=”readmorelink”>Read More

    </div>
    </div>

    <?php endforeach; ?>

    I have added Bold to the main part of the code for this, and Italic to the area which I believe could be the area that needs changing. I have tried get_posts etc.. but to no avail.

    Look forward to any input on this one. Thanks in advance.

Viewing 6 replies - 16 through 21 (of 21 total)
  • have you tried to deactivate all plugins, to exclude a possible interaction from this source?

    adapted code to try to get the post shorter:

    <?php $text = apply_filters('get_the_excerpt', $post->post_content); $words = explode(' ', $text, 80);
    array_pop($words);
    $text = implode(' ', $words);
    echo apply_filters('the_content', $text);
    ?>

    instead of:
    <?php echo apply_filters('get_the_excerpt', $post->post_content); ?>

    Thread Starter ocpplus

    (@ocpplus)

    I haven’t installed any major plugins yet, just GA and webmaster tools, I don’t believe they will affect it but will try. When I replaced the latest code with

    <?php echo apply_filters(‘get_the_excerpt’, $post->post_content); ?>

    The columns went all over the place. Popular posts works fine, but there looks to be an extra string involved for that. If you would like to log in to have a look please let me know.

    Thread Starter ocpplus

    (@ocpplus)

    Right, looks like its working now. I basically deactivated “front page manager” plugin – as you suggested. Then re-added the excerpt code and bingo. Thanks for all your input on this one.

    well done –

    had to be caused by something 😉

    Thread Starter ocpplus

    (@ocpplus)

    Whilst on the subject and before placing this as resolved, how would I include the post image on this with just an excerpt?

Viewing 6 replies - 16 through 21 (of 21 total)

The topic ‘Headache on this theme regarding some code.’ is closed to new replies.