| bio | website | |
|---|---|---|
| location | Koh Phangan | |
| age | ||
| visits | member for | 1 year, 2 months |
| seen | Mar 13 '12 at 2:43 | |
| stats | profile views | 1 |
Most of the time it turn caffeine into code. And mostly code i never wrote before - what fun would it be otherwise... Given the daily advance, i'd say i'm a Noob with extensive knowledge in html,php,mysql who can operate java.
|
Nov 16 |
awarded | Student |
|
Mar 13 |
comment |
Add stylesheets and js to template files when shortcode is used The question is sort of answered. add_action calls are not possible from within the shortcode handler. Thanks helgatheviking |
|
Mar 13 |
comment |
Add stylesheets and js to template files when shortcode is used will do when i can - there's a timelimit for new users |
|
Mar 12 |
comment |
Add stylesheets and js to template files when shortcode is used Haha. Yeah i know - different animal. But it resulted from the 'answer' you gave me. No add_action calls in the shortcode handler forces me to to a workarround ;-) Thx again! |
|
Mar 12 |
comment |
Add stylesheets and js to template files when shortcode is used ok. you have been faster helgatheviking. No add_action calls inside the shortcode handler - Brings me to the next problem - i need data contained in the shortcode to query my db and generate additional markup code - But it does not matter how i define it the variable ends up with the default specified in the shortcode handler. Any idea how i can pre-check if a shortcode is contained in the page and what values are asigned to it? |
|
Mar 12 |
comment |
Add stylesheets and js to template files when shortcode is used I tried the method from the link you posted: add_shortcode('myshortcode', 'my_shortcode_handler'); function my_shortcode_handler($atts) { wp_enqueue_script('my-script', plugins_url('my-script.js', FILE), array('jquery'), '1.0', true); // actual shortcode handling here } but it won't do anything... In the same article it is mentioned that calls from within the body won't work - but the shortcode is only used in posts - that seems like a contradiction. |
|
Mar 12 |
comment |
Add stylesheets and js to template files when shortcode is used could it be that the theme supresses the calls? |
|
Mar 12 |
comment |
Add stylesheets and js to template files when shortcode is used i do and still nothing. the plugin main page holds the add_shortcode and refers to a function in my functions file. it gets called and also errors when messed with but the add_action calls do nothing... |
|
Mar 12 |
asked | Add stylesheets and js to template files when shortcode is used |