only one post category in home page

Discussion in 'BusinessGrow One Page WordPress Theme' started by danteunipv, Jun 9, 2016.

  1. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Dear friend
    can I have only one category post in home page? For example only the news category post.
    Can you write me the code?
    web site: http://web.unipv.it/
    Best regards
    D
     
  2. priya

    priya Guest

    Hi,

    Greetings from InkThemes!

    Please follow the screenshot given below.

    one_blog_cat_frontpage.png

    Code is given below..
    Code:
    global $wp_query;
    $args = array_merge( $wp_query->query_vars, array( 'post_type' => 'post', 'category_name' => 'test' ) );
    query_posts( $args );
    For your information, I am using "WP-Editor" plugin to edit files.

    You can also download and use it from the link https://wordpress.org/plugins/wp-editor/.

    After activating this plugin, you will get the same screen as shown in the screenshot.

    Hope it will resolve your issue

    Do let me know if you need more assistance,

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  3. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Dear Priya,
    Perfect solution: http://web.unipv.it/
    I can include the: code posts_per_page' => 6
    Thanks & Regards!
    Dante
     
  4. priya

    priya Guest

    Great..:)
     

Share This Page