How to make a WP_Query search with custom post types?
You are right, I tried it in a clean WordPress install and it works. Seems like one of the plugins I use in my environment is hooking itself in one of the pre-query events. Thanks!
You are right, I tried it in a clean WordPress install and it works. Seems like one of the plugins I use in my environment is hooking itself in one of the pre-query events. Thanks!
In the edit method for your custom block, when rendering the components you can use the “conditional + &&” pattern: <PanelBody title={ __( ‘My Panel’ ) } > { myCustomBool && <MyComponent value={theValue} onChange={ value => { myChangeCallback(value); } } /> } { ‘marmots’ !== myCustomThing && <MyOtherComponent value={theValue} onChange={ value => { myOtherCallback(value); } … Read more
It is possible, but you’ll have to play a little bit with the actual query. As always, the furious posts_clauses filter comes to action: function wpse_alter_posts_search( $pieces ) { global $wpdb; // Make the input save $search_string = like_escape( $_GET[‘s’] ); // Your new WHERE clause $where = $wpdb->prepare( “$wpdb->postmeta.%s LIKE %s”, ‘YOUR_COLUMN’, // Should … Read more
In short YES, they could have. As anything else could have been implemented as custom post type and/or custom taxonomy. But WordPress is a grown system – now 9 years old – and things are moving slowly to keep most stuff backwards compatible. In short, with WP 3.5, the Links Manager will be moved to … Read more
Scribu’s posts-to-posts is a great and simple plugin, I’m sure we can help you get it working. The basic usage is pretty straightforward. assuming your custom post types are named ‘place’ and ‘event’, the following code would go into your theme’s functions.php file: function my_connection_types() { p2p_register_connection_type( array( ‘name’ => ‘events_to_places’, ‘from’ => ‘event’, ‘to’ … Read more
I managed to get this working using nothing but WordPress filters, thanks to @Milo’s hint. Just note that these are pretty specific to my case but you shouldn’t have a problem modifying them for your own use. I am using Advanced Custom Fields with a Date Picker field called date and Prev/Next links only point … Read more
In functions.php: function mynewproduct(){ myfunction(); } add_action( ‘new_product’, ‘mynewproduct’ ); For more and the official documentation, refer here: http://codex.wordpress.org/Post_Status_Transitions
try ‘has_archive’ => ‘true’; and do the permalink reset before testing! and it should be singular archive-job.php rather than archives-job.php
I think the easiest way, since you’re already using the wp_editor function is going to be to just include the media buttons in the WP_Editor instance – this way you’ll have the native functions, including the “Insert into post” button, built in for free. How you do this obviously depends on the plugin you’re trying … Read more
Instead of ‘cat’ => 12 and $wp_query use ‘category_name’ => slug and get_posts(). Here is a basic example how it works: PHP add_action( ‘wp_loaded’, array ( ‘T5_Ajax_Search’, ‘init’ ) ); /** * Ajaxify the search form. */ class T5_Ajax_Search { /** * The main instance. You can create further instances for unit tests. * @type … Read more