WordPress.org

Support

Support » How-To and Troubleshooting » Php file messing with wordpress loop.

Php file messing with wordpress loop.

  • ok, I know for sure that something in this code is messing with my single post loop. could someone please look it over and diagnose any problems? Thank you. [code]<!– begin sidebar –>

    <div id=”sidebar”>

    <ul id=”sidebarwidgeted”>
    <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(1) ) : else : ?>

    <li id=”Search”>
    <form method=”get” id=”search_form” action=”<?php bloginfo(‘home’); ?>/”>
    <input type=”text” class=”search_input” value=”To search, type and hit enter” name=”s” id=”s” onfocus=”if (this.value == ‘To search, type and hit enter’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘To search, type and hit enter’;}”/>
    <input type=”hidden” id=”searchsubmit” value=”Search” /></form>

    <li id=”About”>
    <h2>About the Author</h2>
    <p>A young entrepreneur ranting, promoting, and discussing what interests him.</p>

    <?php if (is_single()) {
    if (get_the_category()) {
    foreach((get_the_category()) as $category) {
    echo ‘<h2>Related Articles</h2>’.”\r\n

  • “;
    query_posts(‘cat=’.$category->cat_ID.’&limit=10′);
    while (have_posts()) {
    the_post();
    ?>

    <?php
    }
    echo “

  • \r\n”;
    }
    }
    } ?> <?php endif; ?>
    <li id=”Recent”>
    <h2>Recent Articles</h2>

      <?php get_archives(‘postbypost’, 10); ?>

    <li id=”Categories”>
    <h2>Categories</h2>

      <?php wp_list_cats(‘sort_column=name’); ?>

    <li id=”Archives”>
    <h2>Archives</h2>

      <?php wp_get_archives(‘type=monthly’); ?>

    </div>
    <!– end sidebar –>[/code]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Php file messing with wordpress loop.’ is closed to new replies.
Skip to toolbar