• SjoerdHuisman

    (@sjoerdhuisman)


    Dear code-gods of the wordpress support forum,

    I’m busy with designing a website for a client of mine. The webadres is https://www.eentweehupsakee.com. As you can see, the front-page shows the last 4 newly added posts. I want the theme to only show posts from a specific category in these 4 items. I’m using a custom theme named “Widely”. I’ll post the code from the front-page.php file below.

    I’m not an experienced coder so I would like to know which piece of code I have to put where in the php file to get everything to work.
    Hopefully you masterminds can help me out! I would be eternally greatful!

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Thread Starter SjoerdHuisman

    (@sjoerdhuisman)

    Esmi thanks for the reply, but as I said, I don’t know where to put it in this existing code.. I am not a php programmer. Thanks anyway.

    Thread Starter SjoerdHuisman

    (@sjoerdhuisman)

    Esmi I read the page and have found out on my own that I had to change this line. thanks for the reference.

    $args=array('cat'=>$include_category, 'post_status' => 'publish','paged' => $paged,'posts_per_page' => 4,'ignore_sticky_posts'=> 1);

    in to

    $args=array('cat'=> 6, 'post_status' => 'publish','paged' => $paged,'posts_per_page' => 4,'ignore_sticky_posts'=> 1);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show specific category on front page’ is closed to new replies.