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

Tricking the EcoATM in 2022: The Ultimate Guide

  Tricking the EcoATM in 2022 Are you looking to find out how to trick the EcoATM in 2023? If so, you're in luck! This ultimate guide will provide you with all the information you need to know about ecoatm and how to trick it in the year 2023. From finding the best machines to use to learning the most effective tricks, this guide will give you all the tips and tricks you need to master the EcoATM. So if you're ready to start tricking the EcoATM in 2023, let's get started! How do EcoATMs work? EcoATMs are automated kiosks that allow you to exchange your used or broken electronic devices for cash. Found in convenient locations such as malls, airports, and retailers, EcoATMs offer a quick and easy way to turn your old devices into cash. EcoATMs use sophisticated technologies to determine the value of the device. It starts with a visual inspection of the device to identify the make, model, and condition of the item. Then, EcoATM’s patented technology scans the device’s serial n...

SEO Keywords: The Different Types and How to Use Them

 SEO Keywords: The Different Types and How to Use Them What are the types of keywords in SEO? That’s what we’re going to find out in this article! I’ll give you the answer and show you how to use each one correctly for your site. The better you understand your keywords, the more traffic your site will get from search engines like Google and Bing. So let’s dig into what the different types of keywords are and how they can help you improve your search engine rankings, shall we? Understanding the different types of keywords SEO keywords fall into two main categories—long-tail keywords and short-tail keywords . You should also be aware of keyword variations, as they may play a role in your SEO strategy. Long-tail keywords are one or two words in length; short-tail keywords are generally three or four words long. How to do keyword research Start with your keyword. Are you writing a post about golf? Try golf, golf course, golfing, golf tips, and so on. Then dig into related terms. What...

how do you write a guest post - inviting other bloggers to write

  how do you write a guest post the guest post has a single meaning it's inviting other bloggers to write their essays on your blog in other words  1 .  write a clear and conscious bio of the author although  some companies allow you to include links to your website within your blog's main body numerous banned or modified links over time Thus your memoir is presumably the only place in your guest post that will include a  endless link to your website  2 .  include internal links try to include at least one internal link applicable to one of the former posts you posted on the blog they will appreciate this little act that helps increase brand authority and business  3 .  ask generators for sharing and each post with a call to action asking compendiums to leave a comment or partake the further people note and partake your blog the more popular your posts will come in an SEO  hunt promote your guest posts on your social channels it's a ni...