Categories
CMS Mastering Development Wordpress

Theme Code Selects and Displays Certain Related Posts – How to Hide if No Posts Found

I have a paid theme that uses the code below to find related posts (based on tags) and display them nicely. The problem is that even if there is no related posts (i.e. no posts with one or more of the same tags), the heading "Related" is still shown, with nothing below it. How can […]

Categories
CMS Mastering Development Wordpress

Theme Code Selects and Displays Certain Related Posts – How to Hide if No Posts Found

I have a paid theme that uses the code below to find related posts (based on tags) and display them nicely. The problem is that even if there is no related posts (i.e. no posts with one or more of the same tags), the heading "Related" is still shown, with nothing below it. How can […]

Categories
CMS Mastering Development Wordpress

How Display Posts on category

I had a problem, I converted an html template to wordpress, now I want a section Category Enable to display content using categories Does anyone know the solution and code? iam use a code and not work for category : <?php $a = array( ‘posts_per_page’ =>200, ‘offset’ => 0, ‘cat’ => ”, ‘category_name’ => ”, […]

Categories
CMS Mastering Development Wordpress

Pagination not working wit custom Query

I have created a custom Query that works perfectly with my custom post type, inside this custom post type I’m showing an archive with other custom post types: One is a city, and inside each city there will be shown the stores inside this city. THE PROBLEM When trying to apply some pagination (I do […]

Categories
CMS Mastering Development Wordpress

WordPress subcategory archive pagination in custom layout

I have blog with categories and sub-categories and use category.php for archive of main category posts, and added a custom layout for subcategory archive layout as subcategory.php (with a function). In this subcategory archive page, I need a numbered pagination but all I did it returns to 404 Not Found, here my code : function […]

Categories
CMS Mastering Development Wordpress

Meta_query with multiple keys and multiple values

I have a WP Query code like below to check if have post match all post_meta > get that post, else create new post, but the result always show me a post have only loaicua = cua-chinh and loaiphong = phong-khach and i don’t know why. Can someone point out the error in the code […]

Categories
CMS Mastering Development Wordpress

display merged posts from multisite and sort by latest date

i have a code. it works, but not perfectly: every site have the category "noticias" but don’t display posts together ordered by latest date, only as a sequence (blog 1: 3 post order by date, blog 2: 3 post order by date, blog 3: 3 post order by date, etc.) and i want to display […]

Categories
CMS Mastering Development Wordpress

How to pull latest posts from a specific category

I’m trying to pull the latest posts from the category "local-news" but I’m only seeing one of the two posts that exist for this category. I’m not sure if it’s my if statement and/or while loop that’s causing the issue. This is my first time developing a WP theme and using PHP so I’m a […]

Categories
CMS Mastering Development Wordpress

previous_posts_link & next_posts_link doesn’t generate any output

Hey I am using a WPQuery to loop through and show blog categories in posts. It’s in a page tempplate. has 21 posts and I want them to show 10 per page with navigation links for next pages of 10 posts but below code is not outputting that buttons <div class="container-blog-post d-flex flex-wrap justify-content-start"> <?php […]

Categories
CMS Mastering Development Wordpress

previous_posts_link & next_posts_link doesn’t generate any output

Hey I am using a WPQuery to loop through and show blog categories in posts. It’s in a page tempplate. has 21 posts and I want them to show 10 per page with navigation links for next pages of 10 posts but below code is not outputting that buttons <div class="container-blog-post d-flex flex-wrap justify-content-start"> <?php […]