Custom post type split title, setup permalink accordingly

I have been working on this solution, I have come up with a different idea to implement this – I have added two different meta boxes, one with First Name, the other with Last Name Then I have hooked a function with save_post_{$post->post_type} hook like this – add_action( “save_post_{$post->post_type}”, “update_post_data” ); function update_post_data( $post_id ) … Read more

Why custom search engine only searches in post titles of custom posts?

The default WordPress search query only works on post_title and post_content fields from the wp_posts table, not including meta stored on the wp_postmeta table. It really depends on what type of search you want to perform how you could solve this, for instance, “full text”-type search, require a match on a given post meta, custom … Read more

How can I show second most recent post in sidebar, if most recent post is open in the browser?

You can use the WP Query option “post__not_in” for that, this variable should be an array with IDs of posts that should not appear on the result, so you would use it like that: $the_query = new WP_Query(array( ‘post__not_in’ => array( get_the_ID() ), ‘post_type’ => ‘articles’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘orderby’ => ‘date’, … Read more

Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?

There’s no native “Time Interval” field type in ACF, but you could: Use a third-party custom field like the “Date Range Picker” provided by ACF Extended (it’s a commercial plugin that adds features to ACF). Use 2 distinct native Date Picker fields for “from” and “to”, possibly inserted inside a Group. You may take advantage … Read more