how do you display content from custom post type 2 on a single for custom post type 1 that has an ACF relationship?
how do you display content from custom post type 2 on a single for custom post type 1 that has an ACF relationship?
how do you display content from custom post type 2 on a single for custom post type 1 that has an ACF relationship?
Try this in your functions.php file: add_action(‘save_post’, ‘wpb_autogenerate_events_title’, 10, 3); function wpb_autogenerate_events_title($post_id, $post, $update) { // Check if it’s the ‘events’ CPT and if the title is empty. if (‘events’ !== $post->post_type || !empty($post->post_title)) { return; } // Fetch terms from ‘category’ and ‘nameselection’ taxonomies. $category_term = wp_get_post_terms($post_id, ‘category’, [‘fields’ => ‘names’]); $nameselection_term = wp_get_post_terms($post_id, … Read more
ACF Pro simple Business Directory – Requesting assistance with created Templates and associated Functions.php Coding
You can use the update_user_meta function in WordPress to store information about the user’s interest in promoting a campaign // Assuming $user_id is the current user’s ID and $campaign_id is the ID of the campaign. update_user_meta($user_id, ‘promoted_campaigns’, $campaign_id, true);
Custom post type URl Cutomization
how can i call archive-{post type}.php template from my custom plugins to my theams?
This code is pulling in custom posts automatically and setting menu order as it does within the function, so trying to change the order in the menu editor will likely cause an error. To change the order change this line: foreach ( get_posts( ‘post_type=cpt-post-type-here&numberposts=-1’ ) as $post ) { to foreach ( get_posts( ‘post_type=cpt-post-type-here&numberposts=-1&order=ASC’ ) … Read more
Add the parameter hierarchical to the array with value true. This will allow you to create child posts on your CPT. Source: https://developer.wordpress.org/reference/functions/register_post_type/#parameters
Should I save user cookie consent in a custom post type or make a custom database table?
upload featured image using custom post type