Title: single.php, functions.php.. executed multiple times for every post
Last modified: August 19, 2016

---

# single.php, functions.php.. executed multiple times for every post

 *  [tommix](https://wordpress.org/support/users/tommix/)
 * (@tommix)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/singlephp-functionsphp-executed-multiple-times-for-every-post/)
 * **Hi i was using my own shorcodes in functions.php file. lets say**:
 * i have shortcode [date], this will execute function which will write date to 
   the database in my created table so i can retrieve it with other shorcode to 
   show on post content.. so far so good, but….let say i have 100 post with that
   shortcode so when i open ONE POST it will execute that shortcode on EVERY post.
   I tried to add my function and shortcode to single.php -it does the same – runs
   the shortcode in EVERY pos, not only in that who suposte to be updated.
 * **so how can i do this**:
    that ONLY post who is open, lets say [http://www.domain.com/post-1.htm](http://www.domain.com/post-1.htm),
   will be updated and executed, NOT all posts at the same time.
 * P.S date is just an example this is not real deal, so do not explain me how to
   use date and so on. .:)

The topic ‘single.php, functions.php.. executed multiple times for every post’ is
closed to new replies.

## Tags

 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [tommix](https://wordpress.org/support/users/tommix/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/singlephp-functionsphp-executed-multiple-times-for-every-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
