single.php, functions.php.. 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 https://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.