Do you have to use a variable for you script?
I have done this in the past and has worked…
// add script to the footer and break out of PHP
function slider_option(){ ?>
<script>script function data</script>
<?php } ?>
add_action('wp_footer','slider_option');
If this does not work make sure you have the footer hook in you themes footer template file.
<?php wp_footer(); ?>
Related Posts:
- Error: “Cannot modify the return value” c#
- Python conditional assignment operator
- C++ identifier is undefined
- What is the PHP syntax to check “is not null” or an empty string?
- ISO C90 forbids mixed declarations and code in C
- Which variable size to use (db, dw, dd) with x86 assembly?
- Why SQL Server throws Arithmetic overflow error converting int to data type numeric?
- Character constant too long for its type
- What is the meaning of @_ in Perl?
- What is the meaning of @_ in Perl?
- Passing a variable to get_template_part
- What are all the Properties of the WordPress Post Object?
- Passing variables from header.php to template and vice verca
- When to use global $post and other global variables?
- WordPress variables and memory
- How to create custom variables in the wp-config
- Set cookie using GET variable
- {{ Double Curly Brace }} data.____ Variable Source in WP_Playlist Template
- What is the best way to store custom variables
- Setting Cookie Using a Variable from the URL
- WordPress filtering utm_ GET variables from url unless logged in as admin, not sure why?
- Using variable in two functions
- What is the $current_screen global variable?
- How to pass data around?
- How do I pass variables into short-code enabled Post Snippets in WordPress 3.0?
- Replacing string with a variable in php
- Why does a variable work on the front page but return NULL on all other pages?
- Variable scope producing undefined variable notices in included files
- Use to track referrals
- Can you keep session data for visitors?
- Changing static text in a theme into variable content that also respects language. Easiest way
- Result of API Request to global variable?
- Best way to pass variables around a WordPress site?
- How do I share variables between two functions?
- What is the use of $content_width?
- Passing a variable from a FOREACH loop in a link
- What does the Global Variable $s represent?
- Get current page id, title, url, etc
- keep a variable for all pages in memory from the url
- Retrieve custom variable
- Pushing Category and Publish Date to Google Analytics
- Trying to create an edit page link?
- Cron Job variable not accessible
- No access to global variables?
- How to access a variable on all page?
- Not passing correct value to get_post_ancestors?
- Help me edit a variable with php
- SFTP define in wp-config.php
- Preventing Duplicating Posts from Widgets
- saving variables after redirect
- WP CLI – Pass Query / URL Variable to Cron?
- Use a select box to change a php variable
- Can’t access a variable defined in another template despite using GLOBAL
- How to pass a variable for key/value pairs in an argument?
- Where and how to define variables for URLs etc
- How to get variable from function.php to loop file
- Pass variable to next page
- passing javascript variable into php wordpress
- Remove # from a Variable [closed]
- How to pass post title (which could include &) to Gravity Form
- Variables posting twice
- Passing variables trough 2 pages
- update_option using variable name
- assign the returned value of wordpress function to a variable?
- Pass var into wp function instead of direct string text
- How do I echo saved data outside the function?
- Having problems accessing $_GET values
- How to pass variable to functions.php?
- Creating a Variable Product
- Using ‘printf’ on a variable in C [closed]
- Calling a wp_query $posts causes a 500 error
- Remove HTML content if attribute is not set / variable attributes
- Is it better to assign functions like get_the_id() to a variable if it’s used multiple times?
- Variable global scope [closed]
- How to get the most recent modified date of anything in the footer of my site?
- Static variable and add_rewrite_rule?
- How do I get rid of or change the footer in my child theme?
- Append varible to url or set session
- How to wrap the list with custom class using wp_nav_menu?
- Creating dynamic header and footer files
- wp_footer hook only working on homepage not in other pages
- How to pass a PHP $_GET variable and fetch/output it?
- Global Variable vs Local Variable
- persist a variable set in header.php all the way down to footer.php
- get_sidebar() will not work in footer.php
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- Check from functions.php if function exists in footer.php
- echo var into wp_query
- Action ‘init’ function doesn’t return variable
- Passing PHP Variables to AJAX Loaded Pages
- Adding text to the footer of each post based on tags or categories
- How to add another image on footer.php
- WordPress footer always at the bottom of the screen-page
- Make a widget to my footer
- How to add navigation in footer like StackExchange?
- How to add chunk of php, html, and sql code to variable an append to $content
- wp_localize_script not create variable in head section
- Get attachment if matches a variable
- Trying to get this function to show below the content
- How to Keep footer link remain intact?