<?php // Retrieve consistent random set of posts with pagination function mam_posts_query($query) { global $mam_posts_query; if ($mam_posts_query && strpos($query, 'ORDER BY RAND()') !== false) { $query = str_replace('ORDER BY RAND()',$mam_posts_query,$query); //print_r("<p>$query</p>"); } return $query; } add_filter('query','mam_posts_query'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $seed = date('Ymdh'); // Use date('Ymdh') to get an hourly change global $mam_posts_query; $mam_posts_query = " ORDER BY rand($seed) "; // Turn on filter $args = array( 'caller_get_posts' => 1, // Stickies will be repeated if this is not set 'orderby' => 'rand', // This MUST be in the query - the filter checks for it 'paged' => $paged, 'category_name' => 'anwaelte', 'posts_per_page' => 4, 'year' => 2017 ); query_posts($args); $mam_posts_query = ''; // Turn off filter // echo "<br />Seed is $seed, Paged is $paged"; if (have_posts()) { while (have_posts()) { the_post(); echo '<br /><a href="' . get_the_permalink(). '">' . get_the_title() . '</a>' ; } } ?>
// Retrieve consistent random set of posts with pagination function mam_posts_query($query) { global $mam_posts_query; if ($mam_posts_query && strpos($query, 'ORDER BY RAND()') !== false) { $query = str_replace('ORDER BY RAND()',$mam_posts_query,$query); //print_r("<p>$query</p>"); } return $query; } <==============this is unmatched.
<?php // Retrieve consistent random set of posts with pagination function mam_posts_query($query) { global $mam_posts_query; if ($mam_posts_query && strpos($query, 'ORDER BY RAND()') !== false) { $query = str_replace('ORDER BY RAND()',$mam_posts_query,$query); //print_r("<p>$query</p>"); } return $query; } add_filter('query','mam_posts_query'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $seed = date('Ymdh'); // Use date('Ymdh') to get an hourly change global $mam_posts_query; $mam_posts_query = " ORDER BY rand($seed) "; // Turn on filter $args = array( 'caller_get_posts' => 1, // Stickies will be repeated if this is not set 'orderby' => 'rand', // This MUST be in the query - the filter checks for it 'paged' => $paged, 'category_name' => 'anwaelte', 'posts_per_page' => 4, 'year' => 2017 ); query_posts($args); $mam_posts_query = ''; // Turn off filter // echo "<br />Seed is $seed, Paged is $paged"; if (have_posts()) { while (have_posts()) { the_post(); echo '<br /><a href="' . get_the_permalink(). '">' . get_the_title() . '</a>' ; } } ?>
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[SOLVED] Is there a way to make the backround behave like the header? | harpek | Atahualpa 3 Wordpress theme | 7 | Feb 1, 2011 05:05 PM |
[SOLVED] Moving left sidebar - CSS styling for td#left | Wimbledon | Sidebars & Widgets | 4 | Oct 26, 2010 10:39 PM |
Move left left sidebar to bottom of page | sisiblum | Sidebars & Widgets | 2 | May 5, 2009 11:25 PM |
Indenting left margin without a left sidebar showing | rhymes | Sidebars & Widgets | 0 | Apr 28, 2009 09:02 PM |