Adding general custom fields
-
I am currently working on a webpage that show a slider in the homepage. To know which posts it should display there, it looks for posts marked as “featured” (which is a custom field) and it show the X more recent (where X is a number I set in code).
$args = array( 'post_type' => 'post', 'posts_per_page' => 10, 'meta_query' => array( array( 'key' => 'sfeatured', 'value' => 'super-sfeatured', 'compare' => '=' ) ), 'orderby'=>'date', 'order'=>'DESC' ); $the_query = new WP_Query( $args );
I don’t like having to change the amount of posts shown in the slider from the code (now the amount is 10, as you see). I would like to have a “general” custom field in my WordPress admin page where I can set the number of slides I want to show.
What is the best way to approach this?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding general custom fields’ is closed to new replies.