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 } ?>
  • 1
    what does your code that actually queries for the latest posts look like?
    – Milo
    Aug 22, 2012 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, 2012 at 18:54

1 Answer 1


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?

  • 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, 2012 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, 2012 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, 2012 at 15:42
  • 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, 2012 at 16:31
  • Yep I see that, I would consider heading over to the theme developers page and also asking the question there you have asked here. I think and hopefully someone here can confirm "of_get_option" is not part of core Wordpress, but created by the theme/plugin, so the question is more specific and needs more information on what is happening with the theme/plugin.
    – Ant
    Aug 23, 2012 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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