0

Usually PHP questions are strayed away from on the WP stackexchange site so here's a question I had...

to_count_portfolio calls a number of posts selected in a options panel

<?php echo get_option('to_count_portfolio'); ?>

I have a custom query setup and where the "3" is I need to have to_count_portfolio instead. Here is my current code:

    <?php 
        $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 3, 'paged' => get_query_var('paged') ? get_query_var('paged') : 1 )
); 
    ?>

I'm going to assume I need to include $per_page = get_option('to_count_portfolio'); somewhere, but I'm stuck from there.

1 Answer 1

0

Replace 3 with get_option('to_count_portfolio'). Done.

You understand the logic behind? If not just ask.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.