Support » Fixing WordPress » category permlinks when blog is not on the homepage

  • kvnmcwebn

    (@kvnmcwebn)


    Hi,
    I have a static-ish age for the homepage and am wondering how to get my auto generated “read more” category post links to work from the homepage?

    All of the menu items I just put in manual links like this:

    <li class=”catlist” >/category/about”>ABOUT US

    Avellana
    here is the functions code:

    function excerpt_read_more_link($output) {
    global $post;
    return $output . '<a href="'. get_permalink($post->ID) . '"> Read More...</a>';
    }
    add_filter('the_excerpt', 'excerpt_read_more_link');

    I tried custom permlinks settings but that is restrictive. I’d like to do it in the functions file.
    Just any read more or category permlinks to have “category/” before the post name. What is the best way to do this?
    -thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • PSD Bum

    (@wpbum)

    Little confused.

    What do you want the title to link to?
    What do you want the read more link to link to?

    Can you post your loop on page.php? Might be easier just to do it there?

    kvnmcwebn

    (@kvnmcwebn)

    Hi good idea. Not sure how to do that. Here is the code that’s pulling the articles on the homepage. thanks.

    <?php
    $featuredPosts = new WP_Query();
    $featuredPosts->query('showposts=1&cat=19');
    while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
    <h2  style="margin-top:-10px;"><a class="newsletterheader" href="category/avellana-blog/"><?php the_title(); ?></a></h2>
    
    <div class="storycontent">
    <?php the_excerpt(); ?>
    </div>
    <?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘category permlinks when blog is not on the homepage’ is closed to new replies.