rewrite for subpage seems to loose parameter

That’s because in the URL https://mydomain.cl/vehiculos/vehiculo/1599 there are no query parameters, and no GET parameters. This is because you rewrote them into the URL, and they are now query variables. For the same reason $_GET[‘pagename’] wouldn’t work, neither will $_GET[‘auto-id’]. Instead, use get_query_var( ‘….’ );.

Appointment booking system in WordPress

The solution here ultimately depends on how this business functions and how these available appointment slots are structured. Not just in a ‘best case’ scenario, but also providing users with the ability to customize the output/availability of appointments. So, to start you have an ‘appointment’ custom post-type, this you’ve already built. This appointment CPT entries … Read more

How to change the selected Template using javascript?

You are already using the correct action, i.e. wp.data.dispatch( ‘core/editor’ ).editPost(), however, you should instead change the property named template. I.e. wp.data.dispatch( ‘core/editor’ ).editPost( { template: ‘article.php’ } ) Yes, _wp_page_template is the meta key in the database, but in the REST API, a property named template exists in place of direct access on that … Read more

How to make WordPress Plugin run on single specific Admin Page

You should use the load-edit.php action hook, and check for your post type (untested): add_action( ‘load-edit.php’, static function () { $screen = get_current_screen(); if ( empty( $screen->post_type ) || ‘myposttype’ !== $screen->post_type ) { return; } new the_function(); } ); You could also use the current_screen hook, but load-edit.php seems more correct.

SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop

SOLUTION: I looked through Divi’s functions.php & saw that the term for the project tags is ‘project_tag’, so when I amended my $query args it now works! Thank you very much to everyone who responded 🙂 $query_args = array( ‘post_type’ => ‘project’, ‘post_status’ => ‘publish’, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ‘posts_per_page’ => ‘3’, ‘project_tag’ … Read more

Create a custom taxonomy’s term form

WordPress does not provide a hook or any API/function which allows us to move that form, or prevent it from being generated and added to the HTML source. But if you just wanted to visually hide that form, then it can easily be done using CSS, e.g. body.wp-admin.edit-tags-php #col-left { /* Hide the default form … Read more

Show Pods Custom Fields Editor when a page is using a specific template in WordPress

This will remove the meta box for a Pods field group called ‘More Fields’ from the editor for a page not using a certain page template: // remove meta box if page does not use a certain page template add_action(‘admin_head’, function() { $template = get_page_template_slug(get_queried_object_id()); if(‘my-page-template.php’ !== $template) { remove_meta_box(‘pods-meta-more-fields’, ‘page’, ‘normal’); } });