Since you already using get_post_custom
a slightly cleaner yet still dirty (php) way of doing it.
$sermondata = get_post_custom($post->ID);
if( isset($sermondata['sermon_audio']) || isset($sermondata['sermon_video']) || isset($sermondata['sermon_document']))
{ ?>
<div id="downloads">
// rest of your echo output
</div>
<?php } ?>
ps . Just make sure the value is not null
, to be safe you can combine the check with array_key_exists()
(makes it slower though).
Related Posts:
- I’m trying to create an if statement that will only display my button link for tickets if its under ‘admission-event’… what is wrong with my code?
- How do test if a post is a custom post type?
- Display a query with multiple post types and same relationship on a single page
- WordPress Custom Post Types with a page as a parent?
- Limit Authors to their Own Posts on front-end excluding admins
- How to redirect all pages of a custom post type [duplicate]
- Show ACF field from custom taxonomy and display on the single template
- Display children and grandchildren of a custom post type
- is_page_template not working as expected
- Conditional to modify query results
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Get rewrite slug of custom post type in template
- Get Post Primary Category
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Can I create a loop with multiple post types and specify different $args for each post type?
- How to make sure content doesn’t display if selection is empty
- How to customize a permalink (URL) structure?
- How to make a field appear only if a post meta field has a defined value?
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- I’d like to cycle through existing posts in a post type, showing one per day ordered by title, and starting over when the last is reached
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- How to Create Columns with WordPress and CPTUI display page ?
- Search filter triggered & sort by custom post type
- How can I move (or create another) publish button?
- Category.php template for custom posts
- Custom post type causes php-error in php version 5.2.17
- Assign category a default post type
- Saving fields in a drop-down in WordPress
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Different options per post type in WP_Query
- How do I create a new post upon registration with the users first and last name as title
- Query entries from custom post type in an ACF flexible content field
- Creating a non-hierarchical Taxonomy that behaves like categories
- Shortcode is displaying the content on top of the page [duplicate]
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- How to set the mainpage of a custom post type?
- custom post type by author – wp job manager
- Using Wp_Query, Json to add Highcharts series data
- Template code to split a post and print a custom field?
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Let users upload image(s) to the post from front end
- Using page title as a link to term archive
- How to display custom post type only on a certain page?
- Setup page template array in a custom post type
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- WordPress sitemap with Custom Post Types
- How can I sort the order of multiple custom field values in a custom post type?
- Checking for custom field in admin pages
- How do I ensure that post_type and Taxonomy use the same slug?
- pagination for custom post type archive page
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Display All Courses in Course Archive Page
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Is it possible to get the specific content on the search page?
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- open custom post type in popup window instead of page
- Set a template on a custom post in the plugin
- Persist meta box choices throughout all posts of same post type
- Do not show child pages within a file page
- Taxonomy doesn’t follow slug permalink structure
- Looping to organize and display custom posts by category using PHP and WordPress
- Search result based on URL
- Custom search for a custom post type in WordPress
- How to mix 2 kinds of post types
- CPT: execute code after load if parameter is set
- ACF Post Content Not Being Searched
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Show custom taxonomy not in submenu
- Loop carousel slider in wordpress
- How to Fix WordPress 500 Internal server error due to custom post type
- Custom Post save causes 500 error
- Custom post tag images not displaying with ACF
- Function not pulling image or text from custom post type
- Exclude Custom Post Type from shared Custom Taxonomy
- WordPress Custom Post Type and sort by Tags
- Trying to combine multiple WordPress queries
- Looping taxonomy in taxonomy?
- Permalink of Custom Post Type
- posting twice from an array?
- Pagination not working on homepage
- Order custom post type is beign ignored
- How do I filter a custom post type loop by a field?
- How to manage wordpress knowledge base/wiki/posts collections
- How to string lines from the_content() hook in WordPress?
- Get custom post fields and display them
- PHP Button Custom link [closed]
- Getting ACF relationship field information
- How to dynamically register custom post type
- How to I add count of custom posts listed in a post as a prefix to its title
- how to display custom taxonomies in front page