Lock post meta block at the bottom of a custom post type
Lock post meta block at the bottom of a custom post type
Lock post meta block at the bottom of a custom post type
ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
WordPress Rest API only returns content when posttype has editor capability
There’s some contradiction between your question and the code you provided, so I’m not exactly sure which of two scenarios you’re dealing with. Scenario 1 – You want to show all Shops with a specific value for shop-id and all Restaurants with the same specific value for restaurant-id. Let’s say that value is 20. You … Read more
Thanks to Milo’s help the code in the question ended up working: permalinks fixed and the structure stayed exactly how I wanted it described in the question above. Removed the rewrite_rules_array hook entirely Moved my taxonomy registration above my post type registration Changed the taxonomy to be non-hierarchical ‘hierarchical’ => false From my limited understand … Read more
With helpful tips from Milo, I was able to remove the taxonomy slug when no taxonomy is assigned to the custom post type by adding the following code to the updated functions above: add_filter( ‘request’, ‘project_request_filter’ ); function project_request_filter( $request ){ if( array_key_exists( ‘project’ , $request ) && ! get_term_by( ‘slug’, $request[‘project’], ‘project’ ) ){ … Read more
You’re creating a new query, not altering the existing one. The pre_get_posts codex page has a note explaining that the $query argument is passed by reference and you should alter it directly. There’s no need to declare globals or return values. Update your function to be: add_action( ‘pre_get_posts’, ‘only_current’ ); function only_current( $query ) { … Read more
What do u mean by: Page naming ?? If you are after a way to implement this situation, then here you go: You have 2 options: 1st Option Use ‘hierarchical’ => false while registering your apples post type, using register_post_type. Then, you will have the option to put apples posts, as parents and children, using … Read more
This Plugin gives you a list of posts for each Site already, but it does not exactly do what you want to do. Basically, it gives you a list of all posts in your network. What you need to do afterwards is sort them by site_id and create an output for that. I do not … Read more
If you just want to target the first item you can define a variable $first_round=true before you start the loop. Inside the loop, towards the end, you do $first_round=false. So this variable is only true the first time you go through the loop and you can add if ($first_round) echo ‘<div>…</div>’ right after your call … Read more