Virtual page and loading template
Virtual page and loading template
Virtual page and loading template
php dynamic content inside shortcode
There are a few ways to go. The ‘traditional’ way I think would be to create a “Page Template“, and on that template use a custom query (WP_Query) to display the posts from the two post types ordered by date. You’d then add a WordPress “Page” in the control panel and choose your new template … Read more
Change search query in wordpress custom post type
I found the answer here. The query is simply : $meta_query[] = [ ‘key’ => ‘adresse’, ‘value’ => $_GET[‘field’], ‘compare’ => ‘LIKE’ ]; As it will search into the serialized (2D) array of the key adress in the table post_meta from the DB any occurence of my $_GET[‘field’] value. That means it will also search … Read more
register_post_type does not work
Restrict access only of custom post type with standard capabilities to edit_post
WordPress not respecting template hierarchy
Clone wp-admin/users.php (Users Admin Page)
First, you need to create the following function: function checkEmailAlreadyExists( $message_id ) { $posts_with_meta = get_posts( array( ‘posts_per_page’ => 1, // we only want to check if any exists, so don’t need to get all of them ‘post_type’ => ‘my-custom-post-type’, ‘meta_key’ => ‘ticket_id’, ‘meta_value’ => $message_id, ‘fields’ => ‘ids’, // we don’t need it’s content, … Read more