Forum Replies Created

Viewing 15 replies - 151 through 165 (of 222 total)
  • Thread Starter JohnPope

    (@johnpope)

    Sorry, I’ve been away for a week.

    To pull posts from different categories into lists on the frontpage like I have done is pretty simple, but you will need to use multiple loops.

    Below is the basic code that I am using on that page. I’ve stripped it down to a simple form without any formatting so that it is easy to follow. You just need to repeat the loop for as many categories as you want to display.

    <!-- Featured post in 1st category -->
    
    <?php $my_query = new WP_Query('category_name=THEFIRSTCATEGORY&showposts=1');
     while ($my_query->have_posts()) : $my_query->the_post();
      		$do_not_duplicate = $post->ID; ?>
    
    <?php the_title(); ?>
    <?php the_content; ?>
      		<?php endwhile; ?>
    
    <!-- Other posts in the 1st category -->
    
    <?php query_posts('category_name=THEFIRSTCATEGORY&showposts=4'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post();
    		if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
    <?php the_title(); ?>
    
    <?php endwhile; ?>
    <?php endif; ?>
    
    <!-- Next category -->
    
    <!-- Featured post in 2nd category -->
    
    <?php $my_query = new WP_Query('category_name=THESECONDCATEGORY&showposts=1');
     while ($my_query->have_posts()) : $my_query->the_post();
      		$do_not_duplicate = $post->ID; ?>
    
    <?php the_title(); ?>
    <?php the_content; ?>
      		<?php endwhile; ?>
    
    <!-- Other posts in the 2nd category -->
    
    <?php query_posts('category_name=THENEXTCATEGORY&showposts=4'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post();
    		if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
    <?php the_title(); ?>
    
    <?php endwhile; ?>
    <?php endif; ?>
    Forum: Your WordPress
    In reply to: Monkwhy.com

    I think that it’s a bit confused in terms of navigation. I sat here looking at the screen and wondering where I should be looking.

    It also all looks a bit busy.

    If the main thing is to be the 8 video series then I would personally want them on the the front page. As it is, it took me a while to find where to look for them, until I spotted the tab at the top.

    I would also keep the blog on the front page, but make it less the focus of the whole thing. Maybe use excerpts instead of whole posts?

    Forum: Your WordPress
    In reply to: My Inspiration Blog.

    I like it a lot, it’s clean and easy on the eyes.

    The front page thumbnails have a perfect size and are nicely spaced in that grid.

    The content is pretty interesting as well.

    I haven’t counted, but I’d assume it is:

    .postcontent p{margin:0; padding:10px 0 0 0;}

    Just curious, why on earth would you want that many themes?

    Actually I think a lot of people will find it quite useful.

    You don’t pay for the software, so don’t get so uppity about it.

    If you have the ability to change it for your installation then do, if not and it bothers you that much pay someone else to do it. Otherwise just live with it the way it is.

    then it must use the same theme page for both the front page and a single post.

    copy the index.php and create a new file the same with the name single.php

    put it in the same theme folder as index.php

    in the single.php use the_content and in index.php use the_excerpt

    you should be able to use basically any theme, then search in the themes index.php file for

    the_content

    and replace it with

    the_excerpt

    That should do the trick. ??

    Instructions on how to turn the automatically saved revisions off, and also how to delete the existing ones are here:

    https://lesterchan.net/wordpress/2008/07/17/how-to-turn-off-post-revision-in-wordpress-26/

    Names and pictures are two completely different things.

    By using the name of a company or a product in a review or article about a game you are doing nothing wrong.

    Using an image that you have found via Google might well be a copyright infringement though, you should check the ownership of each image you use.

    I’ll agree with Coda, I don’t use anything else these days. It’s great.

    I assume it is running on bbPress

    https://bbpress.org/

    You can do it with this bit of code:

    <?php
    global $post;
    $categories = get_the_category();
    $category = $categories[0];
    $cat_ID = $category->cat_ID;
    
    $myposts = get_posts("numberposts=20&category=$cat_ID");
    ?>
    
    <?php foreach($myposts as $post) :?>
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    <?php endforeach; ?>

    Just change numberposts=20 to whatever number you want to display.

    Ok, I couldn’t get the plugin to work in 2.6, but when I thought about it, I didn’t really need all of the functions of the plugin anyway.

    All I want to do is to display a very simple list of the links to the other posts in the same category.

    This code works perfectly for me, you can see it on any single post on https://johnonfood.com and I think it is also what the OP is looking for.

    <?php
    global $post;
    $categories = get_the_category();
    $category = $categories[0];
    $cat_ID = $category->cat_ID;
    
    $myposts = get_posts("numberposts=20&category=$cat_ID");
    ?>
    
    <?php foreach($myposts as $post) :?>
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    <?php endforeach; ?>

    I’ve used the ‘other posts from cat’ plugin a few times before and it works really well.

    I’ve only just noticed that it doesn’t seem to be working in 2.6 though, or is it just me?

    Anyone got an idea of how to make it work?

Viewing 15 replies - 151 through 165 (of 222 total)