Viewing 2 replies - 1 through 2 (of 2 total)
  • thanks for this tip.

    when i use it, i can get the category, but the number does not seem to respond.

    could you post the whole function you modified in the /inc/functions.php file?

    thanx!

    this works:

    function jlasp_set_featured_post( $number ) {
    	$args = array(
    		'numberposts' => $number,
    		'category' => 2
    	);
    	$recent_posts = wp_get_recent_posts($number);
    	$new_sticky = array();
    	foreach( $recent_posts as $recent ){
    		array_push( $new_sticky, $recent["ID"]);
    	}
    	update_option( 'sticky_posts', $new_sticky);
    
    	return true;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add more Options specified Category’ is closed to new replies.