Title: get_option multiple calls
Last modified: August 19, 2016

---

# get_option multiple calls

 *  [ext103](https://wordpress.org/support/users/ext103/)
 * (@ext103)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/get_option-multiple-calls/)
 * 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)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/get_option-multiple-calls/#post-1749934)
 * 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](https://wordpress.org/support/users/ext103/)
 * (@ext103)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/get_option-multiple-calls/#post-1750021)
 * 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.

## Tags

 * [Get_Option](https://wordpress.org/support/topic-tag/get_option/)

 * 2 replies
 * 2 participants
 * Last reply from: [ext103](https://wordpress.org/support/users/ext103/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/get_option-multiple-calls/#post-1750021)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
