I have the following query in my slider
<?php query_posts( 'category_name=Uncategorized&posts_per_page=3' );
and instead of 3 i need to add dynamically the posts_per_page. For triggering an option for my functions.php theme i usually do
<?php $settings = get_option('mytheme_options'); echo $settings['postspage'];?>
I have tried
<?php
query_posts('category_name=Uncategorized&posts_per_page=$settings["postspage"]');
?>
and it doesn't do anything or echo any error
$postsPage = $settings["postspage"];
query_posts('category_name=Uncategorized&posts_per_page='.$postsPage);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With