## Get Posts in a Custom Post Type category

Question
I have trouble in getting post in a custom post type category. I have code below but it doesnt work well. It still get posts in another category. <?php $query= null;$paged = (get_query_var('paged')) ? ...
0
1 day 0 Answers 7 views

## Order Posts by meta value AND published date

Question
I want to order WP posts by meta key named "sort_date" and if it doesn't exist it should use the post's published date to order posts. Below is the code i am currently using ...
0
2 days 0 Answers 9 views

## meta_query with meta values as serialize arrays

Question
I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in such a way ...
0
3 days 0 Answers 8 views

## WordPress pages for diferent sub categories

Question
Can anyone please help me building one custom code. im trying to make a library with diferent sections when user loads wp page will display sub categories. For expample when user clicks on page comedy the page loads and display all books ...
0
3 days 0 Answers 8 views

## insert thumbnail image from php script

Question
I'm trying to insert a post image thumbnail from my php scritp. It's inserting the post, the content, a download link, and I only need to set the thumbnail image to finish my script. This is my code but I ...
0
4 days 0 Answers 11 views

## Capture search term, input into 2 searches and output data on 1 page

Question
Apologies if this may seem trivial but, although i've been working with Wordpress for a few years now, i only recently started using slightly more complex code implementations. What i am trying to do is the following: Present the user with a ...
0
4 days 0 Answers 11 views

## Replacing search results with custom external query

Question
I'd like to replace the existing search function with an external query (from Solr) but I'm having trouble showing the results in the search.php page. This is the code I have in functions.php: add_action('pre_get_posts', 'my_search_query'); function my_search_query($query) { if($query->is_search() ...
0
4 days 0 Answers 12 views

Question
I have created a new Block for the Wordpress Editor, and I am trying to get a simple WP_Query to work, but so far, the $args in the query are mostly ignored, apart from the post_type setting. For example, I ... 0 5 days 0 Answers 14 views ## wp_query ‘s’ parameter does not work with custom post type Question I have a custom post type 'property'. I am trying to make a search for it, but it does not work with wp_query parameter 's'.$wp_query = Wp_Query(['post_type' => 'property', 's' => 'test']); It works fine with other Wp_query parameters, like this: \$wp_query ...
0
5 days 0 Answers 16 views