Skip to content
Home > Other > Display WordPress Random Sticky Posts

Display WordPress Random Sticky Posts

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #192647
    imFiles
    Member

    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.