Cannot add custom field to “orderby” parameter in Rest API
Cannot add custom field to “orderby” parameter in Rest API
Cannot add custom field to “orderby” parameter in Rest API
Custom post query with multiple fields with number values. Totalisation needed
Even though extending your custom search would be the proper WP way to solve your problem, the answer to your workaround question would be the below function: function change_content_on_save($post_id, $post, $update) { if ($_SERVER[‘REQUEST_METHOD’] !== ‘POST’ || empty($_POST)) return; if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return; if (!current_user_can(‘edit_post’, $post_id)) return; // create your terms list and insert … Read more
WordPress combined with a basic MYSQL table [closed]
I do not know the specific path layout on your webserver, but the entries from the error log do not look to me that it is specifically wordpress related: Invalid method in request \\n\\n This error is caused by an invalid HTTP request. Each HTTP request has a method. Most certainly it was missing in … Read more
I think what you’re saying is that you’re changing the name of the posttype (CPT) itself not the posts within that post type. If that IS the case then WordPress is performing exactly as it should. That plugin is creating a CPT “custompost1” and then you are adding posts (1,2,3,etc) with that post type. Then … Read more
It would help if you listed your $args array, but, the portion you are looking for is under ‘rewrite’. Here’s the way I like to build an $args array for registering a post type: // set up the labels $labels = array( ‘name’ => _x(‘Archived Jobs’, ‘post type general name’), ‘singular_name’ => _x(‘Archived Job’, ‘post … Read more
You can use get_the_post_thumbnail($post, $size, $attrs)/the_post_thumbnail($post, $size, $attrs) for print image full taq or get_the_post_thumbnail_url($post, $size, $attrs) if you want return just featured image url. Also you can use wp_get_attachment_image($attachment_id, $size, $atts) or wp_get_attachment_image_url($attachment_id, $size, $atts) for not featured images but from your media library.
This is far from trivial. URL processing is not straightforward and mostly buried in WP->parse_request() which is not popular to reuse. There is more useful url_to_postid() function, but it’s limited to posts and does not process URL to other things. If really necessary this would take fork of that function to deal with terms. However … Read more
Meta query for custom post type ignored in main query