I believe you want is_user_logged_in
if(is_singular('debate') && is_user_logged_in()) {
// ...
}
(Note: is_singular
is misspelled in your code.)
Related Posts:
- Add custom field in comments form
- custom comments form for custom post type
- Make a custom column sortable by a value from a different custom post type
- comments hooks on custom post type
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Sort custom post archives by a meta value from a different custom post type?
- Custom Fields as Post Type Options
- Custom Post Type Data in Sidebar widgets?
- Hide custom post type field from author?
- Unregister post type from child theme
- Many to Many Relationship between Two Custom Post Types
- Sorting a query by custom field date
- echo value from ‘select’ field type into page template using cmb2?
- wordpress plugin error handling
- Creating Photo Gallery System with Custom Post Type
- Set post title from two meta fields
- Exclude post_type from admin comments_list
- How to sort CPT by custom meta value (date), and return posts month by month
- How to solve suspected memory issue in custom WordPress loop?
- Hook when adding or editing a specific custom post type? [closed]
- Trying to save custom post type from frontend partially working
- Custom Taxonomy order by Custom Field
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- changing default comment form arguments [duplicate]
- Is there any performance consideration when using Custom Post Types?
- Add information above a custom post type listing of all posts page
- “Allow Comments” box cannot be checked
- Custom Post Type Navigation on Custom Field
- how to interconnect custom post types?
- custom comments on specific post type
- WP All Import – Using Xpath to set a select value
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Automatically update custom field in all posts of a custom post type
- Filter custom posts using auto populated dropdown selectors
- Add custom field to Posts and sort by it
- Two Custom Post Types Many to Many Relationship
- Including metaboxes from custom post types in global search — continued
- Show image gallery from a custom field
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- filter custom post in rest api with custom function
- Custom Fields for Custom Post [closed]
- Convert comments to Custom Post Type
- Is there any way to add a “custom field” to the CPT archive page?
- How to assign classes to all elements?
- don’t publish custom post type post if a meta data field isn’t valid
- WebP Fallback for Inline Background Image in Style Attribute
- How can meta boxes be added to “unknown” custom posts?
- Custom “radio button meta box” not saving correctly
- How can I add a filter to a particular post format?
- Check if post with same meta value exists
- Custom posts type for individual pages?
- custom post data – how to
- WP Query ‘posts_per_page’
- Custom Post Type Metadata Not Saving
- Editor / Add Media: Is it possible to only allow galleries?
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- ACF for custom post type archive pages: which hook to use?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- copy images from custom field to another custom field
- Custom Query: If One Post Object Field Value Is The Same As Another
- Enable comments on custom page type – option not showing in “customize” for theme
- How to migrate Custom Field Template to a WordPress Multisite
- Sum and count of custom field values
- Cannot obtain custom meta information
- How to use a specific custom field in a custom post type as slug
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- How to hide a custom field from admin?
- Adding an extra parameter [string] to my posts’ permalink?
- Add Extra Category Field to CPT Categories
- Get the latest comment from a custom post type where depth = 1?
- Empty meta-box returns publishdate if no value is set?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Alike Shortcode using in Custom Shortcode
- Why this didn’t work if i use get_the_ID(), but works if i pass the numeric id
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- Custom Metabox Info Not Saving
- Post Filtered by Custom Field Value
- How to store additional data that is related to core data
- Autofill advanced custom field with user data
- Advanced search form with multiple custom fields
- Meta_Query refuses to return results
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Search facility with directories
- How to create a discussion post when a custom post is created?
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Query events post type after current date and timezone
- Avoid another meta box in my custom post type
- Can’t pick up a field created with Advanced Custom Fields
- Pre_get_posts comparison with custom field doesn’t work
- Post content is cleared when updating
- Unable to get the upcoming events for custom post
- Hook only specific post type
- custom taxonomies are not showing up in get_taxonomies
- How can i display on front page a movie that is atached in a post type
- Create action running on trashed_post hook to modify post_meta value
- how to implement club post type
- Display div based on Group metabox selection [closed]
- Custom Sort Order for Custom Post Type Taxonomy