Bug when using page templates

Forums Forums Menus Bug when using page templates

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1510
    MrMister
    Member

    Hi everybody,

    I’m currently trying to deal with a rather strange behavior of PixoPoint Menu or WordPress that I can’t quite explain…
    My menu is configured to show 2 seperate list of pages as 2 drop down menus via the page menu item and a third drop down menu via the link list aka blogroll. This all works very well and as expected.

    Additionally, I’m having my blog displayed on a seperate page and included via a page template with the following code:

    [code:2m7sdlgt]<?php
    /*
    Template Name: Blog
    */

    $pagenum = $wp_query->query_vars;
    $pagenum = $pagenum[’paged’];

    if (empty($pagenum)) {
    $pagenum = 1;
    }

    query_posts("posts_per_page=10&paged=$pagenum");
    ?>
    <?php get_header(); ?>
    <div id="center">
    <div id="spacer">
    <div id="blog_page">
    <h2 id="myblog" class="section">Mein Blog</h2>
    <?php if(have_posts()): ?><?php while(have_posts()):the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="heading">
    <h2><a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <div class="entry">
    <div class="article_meta">
    <span class="meta"><?php the_date(); ?> (<?php the_time( $d ); ?> Uhr).</span>
    </div>
    <?php the_content(); ?>
    <div class="postmetadata">
    <div class="category"><!– <?php _e(‘Getaggt als:’); ?> <?php the_category(‘ | ‘) ?> –></div>
    <div class="comments"><b><?php comments_popup_link(‘Keine Kommentare verf&uuml;gbar »’, ‘1 Kommentar »’, ‘% Kommentare »’); ?></b></div>
    </div>
    </div>
    <div class="comments-template">
    <?php comments_template(); ?>
    </div>
    </div>
    <?php endwhile; ?>
    <div class="navigation">
    <?php posts_nav_link(); ?>
    </div>
    <?php else: ?>
    <div class="post">
    <div class="entry">
    <p class="errorpage">Ooops, da ist wohl ein Fehler aufgetreten. <br />Die angeforderte Seite kann leider nicht gefunden werden.</p>
    </div>
    </div>
    <?php endif; ?>

    </div>
    <?php include ‘promo.php’; ?>
    </div>
    </div><!– End of #center –>
    <?php get_footer(); ?>
    </div> <!– End of #page –>
    <?php wp_footer(); ?> <!– vorher "get_footer();" –>
    </body>
    </html>[/code:2m7sdlgt]

    It’s nothing special, basically just another loop function.

    The next thing I tried was to disable the first item of both page menus and have them replaced by "#" so a simple click on the hovering menu will not open any new page. I entered the respective IDs of these two pages that are the parent items of each of the menu in the box right where it says "IDs of URLs to exclude" – this works perfectly fine as well, but now my page template won’t work anymore, no articles are being included via the "the_post". Once I undo the last step and have two parent links that actually point to the respective page in the menu my blog template works again.

    Anyone has any idea why this might occur? Is it a bug or a feature?  <img decoding=” title=”Grin” />

    Greetings and thanks for reading,
    MrMister

    #8818

    Try moving your query further down the page:


    ?>
    <?php get_header(); ?>
    <div id="center">
    <div id="spacer">
    <div id="blog_page">
    <h2 id="myblog" class="section">Mein Blog</h2>
    <?php
    query_posts("posts_per_page=10&paged=$pagenum");
    if(have_posts()): ?><?php while(have_posts()):the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    #8819
    MrMister
    Member

    Yeehaa, it works. But I don’t really get where the difference is… Could you give me a hint what I did wrong so I can avoid that mistake the next time over?

    Greetings and thanks for the great support!

    MrMister

    #8820

    I’m guessing what’s happening, is that the plugin is writing it’s own query. So you are creating your own query, then the plugin is creating it’s own query when you load pixopoint_menu(), then you are running your own query after that, but it was obliterated when the plugin’s function loaded.

    Are you perhaps using the recent posts or recent comments menu item? Those would both use queries of some sort so would cause this sort of issue.

    I’ve never seen someone load a query so early in the theme so it’s not something I’ve encountered before.

    #8821
    MrMister
    Member

    Nope, I’m only using the page menu item and the links menu item… It’s still a little misterious to me, but at least it’s working now.

    Thanks again! <img decoding=” title=”Smiley” />

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.