Only category in home page blog box

Discussion in 'Foogo Pro WordPress Theme' started by danteunipv, Jun 12, 2016.

  1. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Dear friends,
    can I have only a category post in a home page blog box area?
    website link: http://cim.unipv.eu/
    ----------------------------------------------
    Inkthemes code
    $args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 2,
    );
    ------------------------------------------------
    My code:
    $args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 2,
    'category' => 1,
    );
    -------------------------------
    but the code is not right.
    Bast regards
    Dante
     
  2. priya

    priya Guest

    Hi,

    Please use below code instead of yours..

    'category_name' => 'your category name'

    It will resolve your issue..

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  3. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Thank you :)
     
  4. priya

    priya Guest

    You're welcome..:)

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  5. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Dear Priyanka,
    I would like a blog post area with: 'orderby' => 'title', and 'orderby' => 'ASC',
    Is my code correct in home page?
    Thanks and regards
    Dante
    ----------------------------------------------------------------
    $args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 2,
    'category_name' => 'NEWS',
    'orderby' => 'title',
    'orderby' => 'ASC',
    );
    ---------------------------------------------------------------
    Can you write me the code for the category page?
    ----------------------------------------------------------------
    <?php
    if (have_posts()): while (have_posts()): the_post();
    get_template_part('content');
    endwhile;
    endif;
    foogo_pagination();
    ?>
    ---------------------------------------------------------------
    Thanks and regards
    Dante
     
  6. priya

    priya Guest

    Hi,

    Code should be like..

    $args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 2,
    'category_name' => 'NEWS',
    'order' => 'ASC',
    'orderby' => 'date',

    );

    Thanks & Regards!
    Priyanka
    InkThemes.com
     
  7. danteunipv

    danteunipv Member

    Joined:
    Feb 3, 2015
    Messages:
    59
    Likes Received:
    1
    Dear Priyanka,
    I wold like a orderby title.
    Can you write the code please?
    ---------------------------------------------------------------
    Can you write me the code for the category page?
    ----------------------------------------------------------------
    <?php
    if (have_posts()): while (have_posts()): the_post();
    get_template_part('content');
    endwhile;
    endif;
    foogo_pagination();
    ?>
    ---------------------------------------------------------------
    Thanks and Regards
    Dante
     

Share This Page