Limit number of posts in work section (3 posts)

    Posted 3 years ago #


    Im having headaches trying to find a solution to this. I have my testing site here: http://manvsape.com/clients/rob/

    In the 'work' section. I want to be able to limit the number of posts that appear, lets say 2 for now and then be able to add a link and create a new page which lists all of the posts.

    The live site has been updated and there are to many items so loading is an issue and lagging on scroll.

    Help urgent!!

  2. ubaidullahbutt
    Posted 3 years ago #

    One easy trick is that, make a category with the name "work".

    Now you will have to show a link to that category, so outside the loop, put

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    global $post;
    $category = get_the_category();
    $thisCat = $category[0];
    echo '<a>category_nicename . '">CUSTOM TITLE</a>';

    For more information, go to http://codex.wordpress.org/Function_Reference/get_the_category

  3. @ubaidullahbutt? Please don't forget to wrap your code snippets in the backtick character or use the code button. You're code will be readable if you do. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.