• Resolved xennox

    (@xennox)


    Hi everyone,

    I am using a commercial theme for the website I’m working on. My homepage is setup with the blog template and it displays all posts like usual. I need it to display only posts from one category and I can’t work it out.
    My theme doesn’t have the option to select categories when I’m using the blog template to create a new page.
    Any help will be greatly appreciated.

Viewing 15 replies - 16 through 30 (of 41 total)
  • Thread Starter xennox

    (@xennox)

    Rajesh Soni

    (@rajeshsoni)

    Thread Starter xennox

    (@xennox)

    It’s driving me nuts. Acting the same.

    Rajesh Soni

    (@rajeshsoni)

    Please post the (1) URL of the page (2) Screenshot of the theme folder (list of files).

    Thread Starter xennox

    (@xennox)

    Page URL: https://mobileupdatecenter.com/pcs/

    https://www.dropbox.com/s/ewvybwbhpdkaskq/Untitled-2.jpg
    https://www.dropbox.com/s/3h51dw4tyib9rzr/Untitled-3.jpg

    I really appreciate your help, Rajesh. Thanks a lot. I can give you ftp access if needed, just tell me.

    Thread Starter xennox

    (@xennox)

    Homepage is using: template-home-v1.php

    Thread Starter xennox

    (@xennox)

    Any new ideas? Still stuck.

    S_Byrnes

    (@s_byrnes)

    Hi, try adding this code on your index.php file, put it right above the loop (php code that says if (have posts) etc)

    <?php
    if ( is_home() ) {
    	query_posts( 'cat=-#' );
    }
    ?>

    Where it has the #, insert the category ID that you don’t want displayed, if you have more than one, separate with a comma. Be sure to have a minus symbol in front of each category ID

    If that doesn’t help you, try this tutorial I wrote the other day, specifically the section titled Stop Posts Displaying In The Main Section.

    Anyway, hope I helped!

    Thread Starter xennox

    (@xennox)

    Can’t find the if with (have posts, anywhere. In the theme directory I have:
    – index.php
    – template-home-v1.php
    – template-home-v2.php
    – template-home-v3.php
    – template-home-v4.php

    If I mess with index.php(tried some code) there’s no influence on my homepage. Even if I delete it.
    If I’m messing with the home templates I must edit all four of them to get results.
    I will go ahead and read your tutorial. Thanks a lot for your intervention, I appreciate it.

    Thread Starter xennox

    (@xennox)

    Great tutorial but unfortunately is not my case.

    This is the template-home-v1.php where probably resides the code of the displayed categories:

    https://pastebin.com/z2ALP122

    Rajesh Soni

    (@rajeshsoni)

    Ok send ftp and i’ll take a look.

    Thread Starter xennox

    (@xennox)

    Thanks a bunch, you guys are my only hope. Here you are:

    [access information removed – you should NEVER post that on a public forum – you need to immediately change it]

    WPyogi

    (@wpyogi)

    You should never, ever post access info on a public forum – please change that immediately on your site. By now, it has likely been indexed by search engined and picked up by other sites.

    @rajesh – your help here is appreciated, but please help here on the forums and do not ask people to post or send you access information.

    Thread Starter xennox

    (@xennox)

    Done. How will I grant you access otherwise?

    WPyogi

    (@wpyogi)

    If you need more help than is offered here, perhaps you should consider hiring someone – you can post a job listing here:

    https://jobs.wordpress.net/

Viewing 15 replies - 16 through 30 (of 41 total)
  • The topic ‘Blog: how to display only selected category?’ is closed to new replies.