It seems that you have forgotten to use <?php
and ?>
properly. Remember to open and close the php tag like the following:
<?php if ( is_singular( array( 'rivista', 'rivista-trimestrale' ) ) ) {?>
<script>
jQuery(function($){
$('.parallax-window').parallax({imageSrc: '<?php echo $ilgelo_options['ilgelo-parallax-image']['url'];?>'});
});
</script><?php
} else { ?>
<script>
jQuery(function($){
$('.parallax-window').parallax({imageSrc: 'STYLESHEETPATH."/img/header-rivista.jpg"'});
});
</script><?php
}
?>
Related Posts:
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to use WordPress (PHP) functions in AngularJS partials files?
- How to stop loading multiple copies of jquery
- How can I loop into two different DIVS without repeating the DIVs
- Click loads template via ajax
- Using PHP to toggle stylesheet and header image, set in cookie
- Change logo based on incoming domain
- How to speed up admin-ajax.php in wordpress
- WooCommerce – Reset quantity input field when variation changes
- jQuery not defined
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- dynamic dependent select dropdown
- How can I get the values of my WordPress $wpdb query in Jquery?
- Ajax load more button for comments wordpress
- wp-comments-post.php file returns a blank page
- How to disable controls in theme customizer?
- Moving code from theme header to functions.php
- linking stylesheets and scripts with functions.php
- Function won’t run onclick using Ajax
- Theme not calling Jquery properly
- Add meta tags to a custom header
- How to make jquery count down timer function manually editable
- Why i can’t get custom fields value or post ID via Ajax?
- Execute Jquery when a specific page in my plugin is loading
- Custom functions for string data calculations
- Execute PHP code only with specific user role
- How to set value selected using select2 jquery plugin
- Database entry removed on browser refresh, Ajax PHP jQuery
- How to send a php var to jQuery Ajax call with two different file
- Reliable way to add nonce to HTTP Header in WordPress?
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- Ajax filter with loadmore button
- Outputting post content to jQuery .html() string
- Update $wpdb query with AJAX
- Using Javascript On Page – Header and Footer Now Missing
- Woocommerce – if selected attribute term equals
- JQuery modal not loading video on popup, only displaying it after multiple reopenings
- How to call a function from functions.php with ajax?
- WordPress load javascript file if something… (after the page is loaded)
- How to call WordPress PHP file using external js file
- Find the method which AJAX GET calls
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Highlight posts currently being edited on multiple editor site?
- Cannot get custom javascript to execute on page
- ajax form function error
- AJAX: WordPress filters inside $html do not work as intended
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- How to use js variable to php in wordpress functions.php
- Replace the image of a product with its video in the shop page
- Dynamic Email Handler with ‘header (“Location: …’
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Setting a cookie upon specific URL visit
- Get_avatar filter?
- Can’t get page content in WordPress
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Way to querry data (tags) from a wordpress database?
- get post based on category chosen in drop down – The ajax method
- Slider loading issue
- Adding Default Settings to Theme My Login plugin
- Image as Sales Badge
- Checking for new message using AJAX and PHP. Server overload?
- how to make separate field in wordpress user_data_
- Function not working at one place
- Displaying the Month and Year that a page was Created?
- Changing custom logo link
- AJAX request status 200 but no actual “response”
- Add a class to the anchor tag on HTML5 gallery
- Remove meta description on certain pages
- add_image_size for header_image
- Menu — How to add “current-menu-grand-ancestor” css class
- Use menu link or onClick to set a variable
- Swapping wp_dropdown_categories function with wp_category_checklist
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Automatically remove a canceled order in Woocommerce
- Display fields as values in array from external SQL DB
- Only Show Link If div Exists
- How to put a variable in a instance in the widget
- Trying to establish connection to External Database
- How to select the contents in the text view textrea in wp_editor?
- add_action shortcut?
- Passing the custom field values in the wp_get_current_user array function
- Using fwrite() and “a” appends multiple times instead of once
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- How to style options page in dashboard?
- How to insert a single row to WP database table?
- Get date numerical and separate?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- WSoD being caused by this piece of code
- wordpress count link clicks by ip address
- Converting HTML Template to WordPress Theme
- Set the background to a default image if there isn’t a specified “featured image”
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Proper syntax or method for keeping url in modified isotope / category links
- Add a variable in functions.php and call it in single.php
- How to access global variable $menu inside a class function