• I was wondering if there was a mod or script that would enable me to have a category display a list of links to posts instead of the posts themselves, as I intend to post a lot and would like to make the navigation easier. So instead of a page full of the actual posts there’d just be a list of links and clicking on a link would bring you to a post.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Nick’s archives could be worth a look ?
    https://mtdewvirus.com/code/mdv-archive/

    could you just edit the template?
    I mean erasing the displaying of the content of the single articles? Since it takes you to the single view when clicking on the title of the article anyway.

    Thread Starter kindpastor

    (@kindpastor)

    sorry–I’m really bad with php I wonder if anybody knows what part of the script I’d need to erase to get to only display the link–and if there’s a way to restrict that display to only certain categories (I want the home category to display actual posts, but not the others)

    This is easy. All you have to do is edit the archives template so that only the post title (aka the permalink) and the post meta data (the date posted) are visible. If you want, you can also use php_the excerpt to post the first few lines of the post or a summary. Try something like this:

    <?php while (have_posts()) : the_post(); ?>
    <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_time('l, F jS, Y') ?></small></div>
    <div class="entry">
    <?php the_excerpt() ?>
    </div>

    <?php endwhile; ?>

    If you want to exclude this option only for certain categories, then you need to look into the Codex documentation of using The Loop, which basically allows you to make arguments based on what the reader is clicking on. For example, in the above code, at the very top you’ll see the line <?php while (have_posts()) : the_post(); ?>. This starts the loop, and basically says, "If there are posts in this selection, then show this information." The Loop ends with: <?php endwhile; ?>

    You can set these “Ifs” to look for anything. Take a look around the forums to find out how to set them for certain categories – there is lots of documentation.

    Thread Starter kindpastor

    (@kindpastor)

    I know I sound stupid but…where might i find the archives template and what is it called?

    Create a template called archive.php

    or you could do this:
    https://codex.www.ads-software.com/Creating_an_Archive_Index

    Most templates, such as the standard-issue Kubrick, already come with an archive.php template. Look into your template files. If there is not one, then you can create one, but it is much easier to edit one that already exists then to start from scratch. Also, a link to your site would be helpful in the future if you need further assistance.

    Thread Starter kindpastor

    (@kindpastor)

    Since the theme i am using “simple green” doesn’t come ith an archives.php file i copied the archives.php file from the default theme–it consists of this:

    <?php
    /*
    Template Name: Archives
    */
    ?>

    <?php get_header(); ?>

    <div id=”content” class=”widecolumn”>

    <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>

    <h2>Archives by Month:</h2>

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

    <h2>Archives by Subject:</h2>

      <?php wp_list_cats(); ?>

    </div>

    <?php get_footer(); ?>

    I have no idea what to add/delete to that to restrict the archives to show comments only–I also am not sure what to seach for regaurding using the Loop. I know I am trying people’s patience but this blog is essentially the first experience I’e had messing with php.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Categories display main link instead of actual post’ is closed to new replies.