Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to have the “latest” boxes on all my pages. How can I fix that?

As it is now it works on the homepage, on the other only one box apperes and but the content is the same as the page it is in.

    <!--LATEST POSTS-->
<div class="center">
<?php if (is_page() ) { ?>
    <?php if(of_get_option('latstpst_checkbox') == "1"){ ?><?php get_template_part(''.$zn_lays = of_get_option('layout_images', 'layout1').''); ?><?php } else { ?><?php } ?>
<?php } else { ?>
    <?php get_template_part(''.$zn_lays = of_get_option('layout_images', 'layout1').''); ?>
<?php } ?>
<!--LATEST POSTS END-->
share|improve this question
1  
what does your code that actually queries for the latest posts look like? –  Milo Aug 22 '12 at 16:29
    
to elaborate on @Milo's question: your posted code only calls a template - what is the code in the template which gets called by the code? –  Michael Aug 22 '12 at 18:54
add comment

1 Answer

Did see your code before, and my original solution would not have worked. Do you have a link to the website this is on?

Maybe a long shot as not 100% sure what this is doing, have you tried changing the value == "1" to == "2" and see what happens?

share|improve this answer
    
I have tried changing 1-2 nothing happened. I want all pages to get the same "latest posts" But every were but the home page the latest news box is posting the content from the page it is on. ransgaard.com –  Anders Aug 22 '12 at 15:30
    
It was a longshot, I think your using this plugin or a theme with this in wptheming.com/options-framework-plugin –  Ant Aug 22 '12 at 15:32
    
I can see what you mean by looking at the website, I think there has to be a loop on your home page or a conditional statement like is_home that is making sure that more than one post is displayed. I am not that experienced with PHP and trying to help out/participate in the forum a little more, but it might be a case of the blind leading the blind here! Sorry. –  Ant Aug 22 '12 at 15:42
    
Thanks for your effort. Ill try again and again... –  Anders Aug 22 '12 at 15:49
    
It´s not just that it´s only one post displayed on the pages. The latest post on pages are just an excerpt from the page there on. –  Anders Aug 22 '12 at 16:31
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.