<?php
$id = get_the_ID();
if (has_post_thumbnail( $id ) ):
$thumb = get_the_post_thumbnail_url($id, 'full');
elseif (tribe_event_featured_image( $id)):
$thumb = tribe_event_featured_image( $event_id, 'large', false, false );
else:
$thumb = get_template_directory_uri().'/images/background.jpg'; endif;?>
<body <?php body_class(); ?> style="background-image: url('<?php echo $thumb;?>'); background-size: cover;">
?>
Also you don’t actually need the elseif
statement, tribe_event_featured_image
is a wrapper for the post thumbnail image with some added wrapping html.
Related Posts:
- Disable The Events Calendar plugin from loading its scripts
- dbDelta not creating tables
- Default table collation on plugin activation?
- How to implement color picker from wordpress in my plugin?
- Nonces can be reused multiple times? Bug / Security issue?
- the_content after all shortcodes are parsed
- How to auto-upgrade my plugin?
- Category listing with thumbnail and description on home page
- How to Add a .js file Only in one specific Page Dynamically to Head
- Displaying search results in the widget itself?
- URLs of plugin resources?
- anything like add_meta_box for categories?
- Missing “category_children” option when dynamically creating categories via a plugin
- Developing a plug-in to charge for
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- What is the Difference between directly call a function and call a function using add_action?
- What is better way to use Bootstrap inside admin panel?
- Looking for callback function after Gutenberg is rendered?
- Updating my plugin without releasing a new version
- How to duplicate a curl XML request using HTTP API?
- 404 errors after plugin options update and category base change
- How to determine, from plugin script, if active theme has The Post Title
- Widget Admin – Form Submit Event?
- add_filter : Passing an array instead of the callback function?
- WordPress security issue to output data from user input from theme option form
- Using wp_parse_args to set up Plugin Default Settings
- how to add Jquery script to one page?
- how do you prevent showing a particular category on the admin dashboard for specific user roles?
- how query string in wordpress receive the value other than post and page [duplicate]
- Problem with parameters in url and pagination
- get_posts() not working when accessing with a custom user role
- Is there no admin ui guide for 4.x?
- Is there an event or an other method that tells me the preview is loaded?
- Where can i find wordpress auto update code flows?
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Do I have to worry about useState causing a re-render?
- How to fetch only current hour posts?
- Plugin sub-menu pages recommended structure and links
- Widget Dropdown doesn’t working
- template_redirect or admin-ajax.php?
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Widget HTML Display Problem
- Display list of uploaded images, filtered by user under a specific user group
- Bug: Post needs to be updated twice when adding action for save_post hook
- my own SVN for a plugin/theme
- How to enqueue scripts in right way in a plugin?
- Activate theme via plugin script?
- How can I add function calls to my plugin’s options.php default submit routine?
- How To Update WordPress Custom Plugin For Customer? [closed]
- Secruity Questions on a timer
- How to rename the plugin PHP file without affecting existent users?
- Add location tag to wordpress posts
- Open tab on current day problem jQuery and WordPress
- Plugin working on my local installation but Cannot be activated online
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- WordPress Page Reload Takes forever during theme development
- How to close tinymce inline popup
- Why doesn’t update_post_meta work for certain strings?
- How to add some basic inline CSS using existing plugin or theme?
- Font size of HTML content
- How to write a shopping queue line plugin with a queue button?
- How to highlight a page in the page list (Admin Menu)?
- New jquery and bootstrap breaks plugin
- How do I add filter with woocommerce categories?
- Where do I hook to have the server do something in PHP on block attribute change?
- Some difficulties in implementing markdown editor
- How to get access the ID of all posts of custom post type in Gutenberg editor
- Share functions between admin and frontend
- Editor Plugin – Breaks when toggling between Visual to Text
- Woocommerce Single Product Tabs Got Duplicate
- Plugin removes itself if mistake made during edit
- Using meta_key & meta_value in add_rewrite_rule
- implementing socket.io with wordpress
- Can’t create a blank template
- Custom Registration Form and Passwords
- Determine if the current page, is being edited
- List Table action argument not cleared
- Looping single post in a theme
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Fullwidth slider using background image Flexslider WordPress
- Return value of $wpdb->update() query in plugin is wrong
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- Plugin files not updated (cache cleared)
- How to limit the number of posts a user can view based on status
- WordPress permalink setting
- How to create an embedded code for wordpress shortcode?
- Error when trying to save custom post type settings (ERROR: options page not found)
- How can I send an id over the url?
- Get fields of a widget
- How to add additional field in a table row after creating a table?
- WordPress plugin tables become corrupt
- How to call a new php page inside a plugin page?
- How can i call from custom fields to the category editor?
- How do you filter get_media_items by mime type in a custom media upload tab?
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Is the only way to add taxonomy terms via an admin panel?
- Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it
- multiple record insert creating many duplicate records