WordPress.org

Ready to get started?Download WordPress

Forums

Older and Newer posts links not working (12 posts)

  1. Kevin Kwok
    Member
    Posted 4 years ago #

    Hello all. Pretty unique situation I have going here.
    I have a link but I dont want it to show up in google so please type
    "build" then the word "HAPPY" and then its a ".net"

    so basically I am using wordpress in a very non-traditional way, I display categories that have posts attached to them but I basically made the front page display the 12 newest categories with the posts that belong to them. Because I am doing this I want the older and newer links at the bottom to display the NEXT 12 CATEGORIES. However they were only made to display/work with posts.... anyone know a fix?

    heres my index.php code:

    Code moderated as per the Forum Rules

  2. Kevin Kwok
    Member
    Posted 4 years ago #

    hmmm sorry not sure what rule i violated, will look into it
    but heres a link to my code i think that should be ok with the rules
    http://wordpress.pastebin.ca/1788501

  3. Kevin Kwok
    Member
    Posted 4 years ago #

    been messing with it for a couple of hours but i cant seem to get this to work

  4. Shane G.
    Member
    Posted 4 years ago #

    Hi,

    It seems that it is due to permalink settings problem. Please reset the permalink from wordp[ress admin area with your requirement and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    After that check with old and new posts of your blog.

    Thanks,

    Shane G.

  5. Kevin Kwok
    Member
    Posted 4 years ago #

    Does anyone know how I can get this to work? My site contains MANY categories that are basically treated as posts, because I am using wordpress this way the "older" and "newer" post links at the bottom do not work.

    I am looking for a way to alter the code so that when a user clicks older posts it basically displays an older set of categories. is this at all possible?

  6. Kevin Kwok
    Member
    Posted 4 years ago #

    I tried downloading page-navi plugin and still cannot get my idea to work properly =(

  7. mduzair
    Member
    Posted 4 years ago #

    i can't be of help, but I have to say queesy that your website is cool. Nice concept and very cool execution

  8. Kevin Kwok
    Member
    Posted 4 years ago #

    Thanks for the kind words mduzair

  9. Kevin Kwok
    Member
    Posted 4 years ago #

    I think I got the phrasing down of what I am asking.

    Is there a way to paginate categories? So that each time I click next page it shows the next 12 categories.

  10. Kevin Kwok
    Member
    Posted 4 years ago #

    if(isset($_GET['sortby']))
    	$sortby = $_GET['sortby'];
    else
    	$sortby = 'DESC';
    $cat_args = array(
    	'orderby' => 'ID',
    	'order' => $sortby,	// New Code
    	'number' => 12
    	);
    if(is_numeric($_GET['paged']))
    add_filter('post_limits', 'test_limits');
    function test_limits($limits)
    {
    $var = (12 * $_GET['paged']);
    return "{$var}, 12";
    }

    This is the section of code from my index.php

    that basically tells wordpress to display the 12 newest categories in descending order. notice the variable "paged" I think I have to do something here.... to make it so "older posts" link displays the next set of 12 categories, but I'm unsure how right now.

  11. Kevin Kwok
    Member
    Posted 4 years ago #

    wheres michael when i need him! =(

  12. Kevin Kwok
    Member
    Posted 4 years ago #

    ive been told it requires custom coding...

Topic Closed

This topic has been closed to new replies.

About this Topic