Summer Sale | Flat 10% OFF on All Themes Package. Use Coupon Code Summer24 | Limited Time Offer! Buy Now

WordPress Website Templates

Find Professional WordPress themes Easy and Simple to Setup

inner banner

latest news by category

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11183
    Heather Clarke
    Participant

    How can i get the short code latest-news to show from a certain category on home page is pro theme

    #11190
    Grace Themes
    Member

    Hi,

    Currently the option is not available to display the latest blog posts from selected category.
    But with some code changes in custom-functions.php file we will do it for you.

    Please send your website URl and WordPress admin login details for temporary at [email protected] so we can check and make this changes.

    We will happy to help you.

    Regards
    Grace Themes

    #11199
    Heather Clarke
    Participant

    email sent, thank you

    #11208
    Grace Themes
    Member

    Hi,

    I have changed the code in custom-functions.php file to display blog post by category

    Just use the categoty=”17″ in latest news shortcode and change the category ID
    [latest-news categoty=”17″ showposts=”3″ comment=”show” date=”show” author=”show”]

    Regards
    Grace Themes

    #39502
    Lucius Douglas
    Participant

    Support,

    You changed the ‘custom-functions.php’ but you didn’t show the before and after code. This would be useful so people could make these changes themselves without bothering support.

    Luke

    #39518
    Grace Support
    Keymaster

    Hi,

    It needed to make the changes in the custom-functions.php file

    Add this at line no. 883

    ‘catname’ => ”,

    Replace below code

    query_posts( array( ‘posts_per_page’=>$showposts, ‘post__not_in’ => get_option(‘sticky_posts’) ) );

    With this:

    $args = array( ‘category_name’ => $catname, ‘posts_per_page’ => $showposts, ‘post__not_in’ => get_option(‘sticky_posts’), ‘orderby’ => ‘date’, ‘order’ => ‘desc’ );

    Regards
    Grace Themes

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.