Categories
CMS Mastering Development Wordpress

How I can use order by of the custom post title?

I have two custom post types case client In case post type I have a ACF custom field to choose a client, so each case have a single client. Now what is working: I am displaying all cases on a page and able to filter them using a client Id. Whats I want: I want […]

Categories
CMS Mastering Development Wordpress

Set WP_query ‘order’ option by another tables value

I created like system in wordpress. And I created ‘sayim_beyenme’ table and created ‘say_post_id’ and ‘total_post_likes’ datas. Now I want to display my posts orderby total likes per each post. I get posts ids with array_map, but I dont know how can I order these posts by total_post_like values. For testing I have used ‘title’ […]

Categories
CMS Development Wordpress

Page not found with Relevanssi on some search pages on my search results

This is how I override the WordPress search page to implement better results thanks to Relevanssi: global $wp_query; $search_txt = get_query_var(‘s’); $args = array( ‘s’ => $search_txt, ‘post_type’ => ‘formations’, ‘posts_per_page’ => 9, ‘paged’ => $wp_query->query_vars[‘paged’], // conserver le numéro de page de la requête initiale ); // filtrer suivant la bonne taxonomy if (isset($_GET[‘taxonomy’])) […]

Categories
CMS Development Wordpress

Creating a custom WP query for a Custom Post Type

I’m trying to create a WP query to search a Custom post type by its title. By using the following code, I get all portfolio posts: $search_query = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 9, ‘paged’ => $paged, ‘post_status’ => ‘publish’ ); If I add the ‘s’ parameter to the query ($search_query[‘s’] = $keyword;), it […]

Categories
CMS Development Wordpress

Weird orderby => post__in issue

I seem to have run into a sort of odd issue with WP_Query post__in I can’t quite figure out. ANY help is appreciated! Goal/Progress so far: Overall I want to merge two arrays and use the merged array inside a WP_Query. I currently have two get_posts queries, one has 5 posts (can be any number), […]

Categories
CMS Development Wordpress

Problem with pagination link (error 404)

I have a problem with wordpress patination. The limit of posts (custom type post “properties”) per page is 9. When I pusblish 11 properties the pagination links works properly. 9 properties in the first page, and 2 in the second page. But, if I publish 10 properties, the link to second page doest work. It […]

Categories
Development Wordpress

wordpress – How to filter post by date,month and year

I create a WordPress post filter page. I want to filter posts by date, month and year. how can I do that? sample.. ‘s’ => (!empty($_REQUEST[“search”])?$_REQUEST[“search”]:”), ‘post_type’ => ‘post’, ‘post_status’ =>’publish’, ‘cat’ => 5, ‘posts_per_page’ => 9, ‘paged’ => 1, (!empty($_GET[“monthnum”])?’monthnum’ =>$_GET[“monthnum”]:false), (!empty($_GET[“year”]))?’year’ => $_GET[“year”]:false), ‘orderby’ =>!empty($_GET[“orderby”])?$_GET[“orderby”]:’date’ );“`