• Resolved Mem

    (@mem)


    I used to use Custom Query String by Matt Reader to list my archives A-Z And to change the amount of posts displayed. Its now not working anymore to alphabetise my archive post categories.

    Eg https://www.mouthwateringmunchies.com/?cat=101

    I have googled for over 4 hours trying various fixes & plugins but still can’t get anything to work. So here is me giving in and hoping someone here has a fix.

    This is the code on my Archive php – I’m using the Magazine shack theme.

    <?php get_header(); ?>
    
    	<div id="content">
        	<div id="content2">
    
    		   <?php if (have_posts()) : ?>
    
              <?php /* If this is a category archive */ if (is_category()) { ?>
                <h3 class="arc">Archive for the ‘<?php single_cat_title(); ?>’ Category</h3>
              <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
                <h3 class="arc">Posts Tagged ‘<?php single_tag_title(); ?>’</h3>
              <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
                <h3 class="arc">Archive for <?php the_time('F jS, Y'); ?></h3>
              <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
                <h3 class="arc">Archive for <?php the_time('F, Y'); ?></h3>
              <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
                <h3 class="arc">Archive for <?php the_time('Y'); ?></h3>
              <?php /* If this is an author archive */ } elseif (is_author()) { ?>
                <h3 class="arc">Author Archive</h3>
              <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
                <h3 class="arc">Blog Archives</h3>
              <?php } ?>
    
                <?php while (have_posts()) : the_post(); ?>
                 <!-- start entry post -->
                <div class="post">
                    	<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
                    </div>
    
                 <!-- end entry post -->
                <?php endwhile; ?>
    
                <div class="navigation">
                <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
                </div>
                <?php else :
    
                    if ( is_category() ) { // If this is a category archive
                        printf("<h2>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false));
                    } else if ( is_date() ) { // If this is a date archive
                        echo("<h2>Sorry, but there aren't any posts with this date.</h2>");
                    } else if ( is_author() ) { // If this is a category archive
                        $userdata = get_userdatabylogin(get_query_var('author_name'));
                        printf("<h2>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name);
                    } else {
                        echo("<h2>No posts found.</h2>");
                    }
                    get_search_form();
    
                endif;
            ?>
    
    		</div>
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Mem

    (@mem)

    I don’t have a category php page and couldn’t work out how to get it to work.

    Thread Starter Mem

    (@mem)

    My index.php

    <?php get_header(); ?>
    
    	<!-- start content -->
        <div id="content">
        	<div id="entries">
    			<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    query_posts("showposts=5&paged=$paged"); ?>
    
                <?php while (have_posts()) : the_post(); ?>
    
                 <!-- start entry post -->
                <div class="entry" id="post-<?php the_ID(); ?>">
                	<div class="entryinfo"><?php edit_post_link('Edit', '', ' &nbsp;&bull;&nbsp;'); ?> <?php the_time('d M Y'); ?> &nbsp;&bull;&nbsp; <?php the_category(', ') ?> &nbsp;&bull;&nbsp; <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></div>
                    <div class="post">
                    	<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    					<?php the_content(); ?>
                    </div>
                </div>
                 <!-- end entry post -->
                <?php endwhile; ?>
            </div>
            <div class="navigation">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
            </div>
        </div>
        <!-- end content -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    The archive.php would be what your theme uses instead. You can make changes to that file and save in your child theme’s folder.

    I didn’t see your theme in the www.ads-software.com list, so perhaps you’ll need to contact the site where you downloaded it from for support on customizing their templates.

    (The theme you are using is “Christmas” not Magazine shack. Author URI: https://www.dreamtemplate.com/)

    Thread Starter Mem

    (@mem)

    No it’s Magazine Shack. I renamed it.

    All the changes I have made dont seem to work .. hence why I have come here. Thanks anyway.

    Thread Starter Mem

    (@mem)

    ok I’ve noticed part of the page is a-z and the other isn’t .. like it’s doubling the posts in category archives

    Thread Starter Mem

    (@mem)

    Was wp-sticky plugin interfering

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Alphabeticalisation of Archive Titles?’ is closed to new replies.