Display only the most recent sticky post, display other posts in chronological order

That page has exactly what you need: Display just the first sticky post, if none return nothing: $sticky = get_option( ‘sticky_posts’ ); $args = array( ‘posts_per_page’ => 1, ‘post__in’ => $sticky, ‘ignore_sticky_posts’ => 1 ); query_posts( $args ); if ( $sticky[0] ) { // insert here your stuff… } Source: http://codex.wordpress.org/Sticky_Posts Then add your normal … Read more

Set sticky posts schedule (Automatic)

OK I got it working this is the code I used, I am not sure if it is the best practice but it certainly works. In functions.php where I make the posts sticky from the front-end I added this to update the post_date to today so I can have control over the sticky period: $newdate … Read more

Exclude sticky post from main query?

query_posts isn’t recommended because its breaks things. You’re really close, but just declaring the function itself will not work. You need to hook the function into something. In your case, this would be pre_get_posts. Example (with “namespaced” function): <?php // this is key! add_action(‘pre_get_posts’, ‘wpse74620_ignore_sticky’); // the function that does the work function wpse74620_ignore_sticky($query) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)