- This topic has 4 replies, 2 voices, and was last updated 14 years, 5 months ago by MrMister.
-
AuthorPosts
-
June 22, 2010 at 11:42 pm #1510MrMisterMember
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ü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? ” title=”Grin” />
Greetings and thanks for reading,
MrMisterJune 23, 2010 at 10:54 am #8818imported_RyanMemberTry 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(); ?>">June 23, 2010 at 11:14 am #8819MrMisterMemberYeehaa, 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
June 23, 2010 at 1:57 pm #8820imported_RyanMemberI’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.
June 23, 2010 at 2:42 pm #8821MrMisterMemberNope, 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! ” title=”Smiley” />
-
AuthorPosts
- You must be logged in to reply to this topic.