• Resolved CharlesClarkson

    (@charlesclarkson)


    A customer was using qTranslate and referred me to this post where the site admin says:

    … get_option is not supposed to be used in templates …

    That’s true when using qTranslate, but is it true in general?

    And if it is true, why is it true?

    TIA,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Don’t know why it would be bad…for example how else to do this:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=1&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
    ?>
    Thread Starter CharlesClarkson

    (@charlesclarkson)

    Thanks, Michael.

    I noticed that get_bloginfo() uses get_option() to retrieve some values. I assume the qTranslate author is using either the ‘bloginfo_url’ or ‘bloginfo’ filters and that is the source of his complaint.

    I appreciate the answer,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is get_option() Not For Templates?’ is closed to new replies.