Skip to main content

How to Fix Post Tags Error for Custom Post Type Post in WordPress | Warning Foreach Argument Type Fix

 welcome to Webnewster.xyz 

 see this error warning for each argument must be of type array object bool this is not a regular post this is custom post in a custom post type this is custom post type


 test post type we've got two posts here so if i go to my regular posts these are my posts and i go to single post we see these tags at the end of this post and these tags will work but for this custom post type we don't have tags here that is why we are looking at this warning here these tags are coming from the template appearance theme editor and template parts single single layout and here this is some custom code to display tags for single post 

so we have got global post here and then post id as tag get the tags so these tags are not available for custom post type like this test post type that is why we are looking at this error for this custom post type and the solution is to just check if this is single post and post type is post not test post type like check right here if and inside if use is single and post type is post

 then display all of this then display tags and this is a mistake here this is not single this is singular update file and let's refresh this blog post that is a regular post in our wordpress site so we can see tags here and now for our custom post type we will refresh it and the error is gone from here because we are just checking if the if this is single post and post type is post

 then get the tags and tags were not available for this custom post type so these were not showing here and we were looking at the warning for each argument must be of type array object bull okay i hope it helped like share subscribe and i will see you in the next video

Comments

Popular posts from this blog

Why we are adding hastags in our social network/increase views/best hastag generators

                               WITHOUT HASTAG:        1. If you post video in social media  whithout Hastag              like Facebook, YouTube ,Twitter, Instagram and              ETC....                 2.Then Result : single digits views and likes in one               day  😥😥              3.No- subscribers , followers,  viewers.       ADDING HASTAG:                 1. ADDING HASTAG- To get more views,  subscribe,                 follower in social networks.         2. There is many HASTAG Generators in Google.com           fo...

best SEO company |SEO company primelis | SEO |

 Professional SEO Company for your business.  There are over 5 billion searches online every day and 93% of online experiences begin with searching along with high quality backlinks. organic seo company 80% of users ignored paid ads & never scroll page one. 93% successtop SEO company Top 3 results on google and other search engines by SEO services in the organic ways. SEO company in USA.  You need a serious and powerful ranking service to, web design seo company reach search visibility and can guarantee to take your website to the top of search engines Backlinks are any links received by your website from another website seo company rankings and high PR backlinks Only high quality backlinks matter bad links can be harmful for website ranking. The good news is Egochi is the best seo company that can provide high PR backlinks for your website Safe, organic and natural seo services along with seo backlinks compatible with Google algorithm All links are manually buil...

Does Wordpress update affect frontend?

  WordPress - CMS WordPress is a content management system that allows people to publish their own websites or blogs. It is one of the most popular CMS (content management system) on the internet. WordPress updates are released periodically and these updates are done for security fixes and bug fixes. These updates may not affect the front-end of your website, but they can affect the backend. WordPress updates WordPress updates are done to improve the user experience and make WordPress more secure. However, with every update, there is a chance that it will break something on the frontend. The latest WordPress release (4.9) has caused some issues for many users with their front end of a website. This includes issues with displaying images, sidebar widgets not showing up, and other minor bugs in the site’s appearance.