This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: 

Remove Posts and Categories from sitemap

  • Creator
    Topic
  • #18843
    abakus
    Participant

    Please, help me to manage and modify the template_sitemap.php for Akita,
    I need to remove Categories and Post also to order the pages .
    Please don’t bring me to a online support guide main page.

    I’ve been looking it on this forum but useless.

    Thank you
    Sergio

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #18844
    Jason Bobich
    Keymaster

    Hello Sergio,

    For any code customization you’ll need to make to the theme, this may require you to read up on a couple subjects.

    First, you’ll need to make sure you have a child theme setup.

    See video: https://vimeo.com/70832266

    Switching to a child theme after you’ve started your site: http://dev.themeblvd.com/tutorial/switching-to-a-child-theme-after-youve-already-started-building-your-website/

    Then, simply copy content-template_sitemap.php to your child theme in order to edit it. Within, just delete the sections listing out category stuff. Probably you just want to delete this:

    <h2><?php echo themeblvd_get_local( 'categories' ); ?></h2>
    <ul>
        <?php wp_list_categories('title_li=&hierarchical=0&show_count=1') ?>
    </ul>
    <h2><?php echo themeblvd_get_local( 'posts_per_category' ); ?></h2>
    <?php $cats = get_categories(); ?>
    <?php foreach ($cats as $cat) : ?>
        <?php query_posts('cat='.$cat->cat_ID); ?>
            <h3><?php echo $cat->cat_name; ?></h3>
            <ul>
                <?php while (have_posts()) : the_post(); ?>
                <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> - <?php echo themeblvd_get_local( 'comments' ); ?> (<?php echo $post->comment_count ?>)</li>
                <?php endwhile; wp_reset_query(); ?>
            </ul>
    <?php endforeach; ?>

    For the order of the pages, this is actually controlled from your WordPress admin, based on the “Order” option when editing each page.

    … By default, they’re all set to 0, but you can set them like 1, 2, 3, 4, etc.

    Or, if you wanted an automated code change, like to order everything by title or something, then under the Pages section in content-template_sitemap.php, you find the wp_list_pages() function, and you can modify the query string of parameters passed in.

    http://codex.wordpress.org/Function_Reference/wp_list_pages

    … see the “sort_column” and “sort_order” parameters. For example:

    <?php wp_list_pages('depth=0&sort_column=title&sort_order=ASC&title_li=' ); ?>
Viewing 1 replies (of 1 total)
  • The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.