Show Random Post On Theme Specific Widget (PRO)

Home Forums WordPress Theme Support BresponZive Mag Show Random Post On Theme Specific Widget (PRO)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1963
    VioAdmin
    Member

    Hi, first of all great theme — I like your style and I hope you continue to make more so that I can buy them for my future sites, before that I have a small issue…

    I want to have the option to show RANDOM posts on *THEME SPECIFIC 2 COLUMN WIDGET*

    I believe it is a simple edit but I can’t seem to find it…I googled and found this helpful pages:

    http://www.devtoolsplus.com/how-to-display-random-posts-with-thumbnails-in-wordpress
    http://www.wpbeginner.com/wp-tutorials/how-to-display-random-posts-in-wordpress

    I thought I would simply add something like this: <?php $posts = get_posts(&#039;orderby=rand&numberposts=5&#039;);

    But I don’t seem to find it in your widget(s) — Where can edit your widgets so that I can switch from LATEST POSTS to Random Posts so that on each page reload, new posts show up.

    Please help me in anyway you can, I have been trying to solve this for hours but I have failed…

    #1981
    Raja CRN
    Keymaster

    Hi,

    Here, I’ll show you the sample code to get Random posts in Magazine style widget. Just follow the below code, and add the lines in the widget file.

    $magazine_doub_posts = new WP_Query(array(
    'showposts' => $posts,
    'cat' => $get_catego,
    'orderby'=> 'rand' //the code you need to add
    ));

    Thanks.

    #1992
    VioAdmin
    Member

    Thanks a lot! It worked perfectly!

    #2048
    samirsoccer
    Member

    VioAdmin Can you explain it, what file you actually edited I’m bit confused 😀

    thank you

    #2049
    VioAdmin
    Member

    Hi Samirsoccer,

    You just have to edit the right widget file(s) located here: /public_html/wp-content/themes/bresponzive_pro/admin/widgets/

    1.) Inside that folder you will find: homepage_singlet_widget.php

    2.) You will also find: homepage_doublet_widget.php

    Edit either one of them(or both) by using the code Raja gave us and it should work perfectly. 🙂

    Let me know if this works out!

Viewing 5 posts - 1 through 5 (of 5 total)

Only Verified Customer of this Theme Can post reply to this Support Topic! .