• hello everyone, just a quickie.

    i have a <ul> of bookmarking icons on my new theme. when clicked they all use a function i created to get post short url

    here it is
    function ext_theme_short_url(){global $post; echo get_bloginfo('url')."/?p=".$post->ID;}

    now, should i add this to each href for each icon? like this
    <?php echo ext_theme_short_url(); ?>

    or should i call it like this?

    $link = echo ext_theme_short_url();

    and then add
    <?php echo $link; ?>

    to each href.

    i guess what i am asking is will this reduce the mysql lookup from many requests to 1?

Viewing 2 replies - 1 through 2 (of 2 total)
  • If I understand it correctly, since get_bloginfo(‘url’); ‘eventually’ uses get_option, and the site_url and home values are autoloaded, I’d guess there’s only one read of the database and that’s done automatically by WordPress core.

    Thread Starter ext103

    (@ext103)

    is that right?

    i mean when you call an option, does it only call it once per page?

    say i had get_bloginfo(‘url’); called 5-6 times on the same page.

    would that give me 5-6 database calls or one?

    thanks for posting

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get_option multiple calls’ is closed to new replies.