Display WordPress Random Sticky Posts

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #67329
    imFiles
    Administrator

    I am using this code on the FrontPage of this site to Display WordPress Random Sticky Posts.
    stickyrandom
    First of all you need to make the posts to appear randomly sticky :mrgreen: than add the following code where you would like to display the random WordPress sticky posts.
    This code consist of three parts, first we call the query to get the stickies as such

     1, 'post__in' => get_option('sticky_posts'), 'caller_get_posts' => 3, 'orderby' => rand); query_posts($args); if (have_posts()) { while (have_posts()) : the_post(); if ( is_sticky() ) : ?>

    Than we insert the HTML as such

    "> 

    ">

    ... ">Read More »

    So it will look like this after is all added together

     1, 'post__in' => get_option('sticky_posts'), 'caller_get_posts' => 3, 'orderby' => rand); query_posts($args); if (have_posts()) { while (have_posts()) : the_post(); if ( is_sticky() ) : ?> "> 

    ">

    ... ">Read More »

    I remove all the CSS but left like getting title, excerpt, thumbnail in case you guys would like to use some of that stuff 🙂

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.