WordPress.org

Ready to get started?Download WordPress

Forums

Archives not working (5 posts)

  1. semaja2
    Member
    Posted 8 years ago #

    Hey guys,

    On my blog http://semaja2.net for some reason the archive lists for categories and time are not working,

    They seem to list EVERY post ive made not the ones that they should be showing, any ideas?

    http://files.semaja2.net/archive.txt -- archive.php file just incase

    i have checked all plugins and non of them are causing it

  2. semaja2
    Member
    Posted 8 years ago #

    anyone?

  3. semaja2
    Member
    Posted 7 years ago #

    please someone help out?

  4. samsarin
    Member
    Posted 7 years ago #

    I believe that the query is causing you problems:


    <?php $amonth = substr($m,4); ?>
    <?php $ayear = substr($m,0,4); ?>
    <?php query_posts('posts_per_page=-1&monthnum='.$amonth.'&year'.$ayear); ?>

    When I disable permalinks on my test blog the above works correctly, but if I enable it then it shows all entries. If you remove the query, the loop will build the query for you correctly on the archives page.

    This is probably because without permalinks, ?m= is used on the URL, but with permalinks it is not. If you want to format the date differently for the archives, you can get the first post and use the_time() on it.

  5. semaja2
    Member
    Posted 7 years ago #

    ok well i fixed that but now the categories are broken, they only list 5 posts for multialarm but there is actually about 20

    <?php get_header(); ?>

    <div id="main">
    <div id="content">

    <div class="entry">
    <h1>Browsing the <?php $catname = get_the_category(); echo $catname[0]->cat_name; ?> category</h1>
    Below is a list of every entry made in the <?php echo $catname[0]->cat_name; ?> category.

    <ul id="archivelist">
    <?php while(have_posts()) : the_post() ?>

  6. <span><?php the_time('d. M Y'); ?></span> " title="Read <?php the_title(); ?>"><?php the_title(); ?>
  7. <?php endwhile; ?>

    <script type="text/javascript"><!--
    google_ad_client = "pub-5841443599987490";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "336699";
    google_color_bg = "FFFFFF";
    google_color_link = "0000FF";
    google_color_url = "008000";
    google_color_text = "000000";
    //--></script>
    <div class="center"><script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></div>

    </div>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.