{"id":8068,"date":"2010-01-09T19:01:10","date_gmt":"2010-01-09T19:01:10","guid":{"rendered":"https:\/\/www.amitbhawani.com\/blog\/?p=8068"},"modified":"2010-08-09T20:36:11","modified_gmt":"2010-08-09T20:36:11","slug":"display-ads-related-blog-categories","status":"publish","type":"post","link":"https:\/\/www.amitbhawani.com\/blog\/display-ads-related-blog-categories\/","title":{"rendered":"Show Advertisements based on WordPress Blog Categories"},"content":{"rendered":"<p>I have a WordPress blog where i write reviews on different products and services ranging from web hosting, gadgets, mobile phones to digital cameras. Iam currently planning to setup affiliate links and banners in my blog because now i have got excellent traffic who visit my blog daily searching for reviews and i want some kind of setup in which i can display different advertisements for each category on my blog. Is there any possibility for this kind of system like any paid wordpress plugin or any php codes etc. Question by Ranjith who runs a high ranking wordpress based blog.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/01\/Targeted-Advertisements.jpeg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/01\/Targeted-Advertisements-150x150.jpg?resize=150%2C150\" alt=\"Targeted Advertisements\" title=\"Targeted Advertisements\" width=\"150\" height=\"150\" class=\"alignright size-thumbnail wp-image-8077\" \/><\/a><strong>Solution : <\/strong> WordPress is one of the most flexible Content Management System which can be used to develop a blog, shopping portal, <a href=\"https:\/\/www.amitbhawani.com\/blog\/tips-start-jobs-portal-blog-theme-plugins-ideas\/\">jobs portal<\/a> to a static looking website. Overall you can customize it in anyway by just finding the right links which can help you in setting this up. You can use different plugins in wordpress in order to show the advertisements on different locations of your blog but there seems to be no plugin which can help you in showing different ads on different categories.<\/p>\n<p>Hence, its recommended to tweak into the Category Function of WordPress and tweak it so that you can show ads on different sections. Located at &#8211; http:\/\/codex.wordpress.org\/Template_Tags\/in_category , you can get a code as follows :<\/p>\n<p>This wordpress function is going to use the if function and search for the Category ID and display the advertisement whenever found. You just need to add the ad code in between the following code and then add the whole code in your theme files.<\/p>\n<p>&lt;?php if ( in_category(&#39;category_id&#39;) ): ?&gt;<br \/>\n\/\/ Your Category Specific Ad Code here<br \/>\n&lt;?php endif; ?&gt;<\/p>\n<p>This way you can display content or category related advertisements on your blog instead of running the same ads on the whole blog. Do check out a similar article which can help you in showing <a href=\"https:\/\/www.amitbhawani.com\/blog\/how-to-show-ads-only-on-homepage-in-wordpress\/\">ads on homepage<\/a> of wordpress blogs. Let us know if you have any other queries regarding this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a WordPress blog where i write reviews on different products and services ranging from web hosting, gadgets, mobile phones to digital cameras. Iam currently planning to setup affiliate links and banners in my blog because now i have got excellent traffic who visit my blog daily searching for reviews and i want some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":19570,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[376],"tags":[],"class_list":{"0":"post-8068","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-wordpress","8":"entry"},"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/12\/Targeted-Advertisements-150x150.jpg?fit=150%2C150&ssl=1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":9456,"url":"https:\/\/www.amitbhawani.com\/blog\/google-adwords-advertising-system\/","url_meta":{"origin":8068,"position":0},"title":"Google Adwords &#8211; Becoming a Google Advertiser","author":"Amit Bhawani","date":"March 29, 2010","format":false,"excerpt":"Google Adwords is a advertising network using which you can create and place ads for your business on different Google partner websites. Unlike traditional advertising like Banner Ads, in Google Adwords you don't have to worry about the costs and budgets because you will be charged on click basis only\u2026","rel":"","context":"In &quot;Google Adwords&quot;","block_context":{"text":"Google Adwords","link":"https:\/\/www.amitbhawani.com\/blog\/category\/adwords\/"},"img":{"alt_text":"Google Adwords Logo","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/google-adwords-logo.jpg?fit=378%2C378&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8391,"url":"https:\/\/www.amitbhawani.com\/blog\/start-free-classified-ads-site\/","url_meta":{"origin":8068,"position":1},"title":"How to Start Free Classified Ads Site &#8211; Scripts &#038; Make Money","author":"Amit Bhawani","date":"February 7, 2010","format":false,"excerpt":"We have previously written different articles on how to start a jobs site, mobile site, private blogs etc and this time iam going to write down a detailed article on how to start a free classifieds site, what are advantages of starting classifieds site and how to setup one of\u2026","rel":"","context":"In &quot;How to Guide&quot;","block_context":{"text":"How to Guide","link":"https:\/\/www.amitbhawani.com\/blog\/category\/how-to\/"},"img":{"alt_text":"Free Classifieds Ads","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/02\/free-classifieds-ads-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9551,"url":"https:\/\/www.amitbhawani.com\/blog\/adwords-ads-check-up\/","url_meta":{"origin":8068,"position":2},"title":"Check if Adwords Ads are Up with Ads Diagnostic Tool","author":"Amit Bhawani","date":"March 30, 2010","format":false,"excerpt":"Once you have setup your campaign and ensured that its running, you need to check out if the advertisements are actually being shown on the Google search results pages, and for this you need to perform Google searches and surf through a few pages. Normally once you have setup the\u2026","rel":"","context":"In &quot;Google Adwords&quot;","block_context":{"text":"Google Adwords","link":"https:\/\/www.amitbhawani.com\/blog\/category\/adwords\/"},"img":{"alt_text":"Adwords Ad Preview Tool","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Adwords-Ad-Preview-Tool.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Adwords-Ad-Preview-Tool.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Adwords-Ad-Preview-Tool.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Adwords-Ad-Preview-Tool.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Adwords-Ad-Preview-Tool.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":4487,"url":"https:\/\/www.amitbhawani.com\/blog\/track-visitors-clicks-heatmap\/","url_meta":{"origin":8068,"position":3},"title":"Track Visitors Clicks with Visual Heatmap","author":"Amit Bhawani","date":"May 29, 2009","format":false,"excerpt":"If you are running a blog or a website with advertisements on it, you will be always confused where to place ads because you are looking for the highest sales or pay per clicks on the available visitors count and for this you need to know at which location do\u2026","rel":"","context":"In &quot;Tips &amp; Tweaks&quot;","block_context":{"text":"Tips &amp; Tweaks","link":"https:\/\/www.amitbhawani.com\/blog\/category\/tips-tweaks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10913,"url":"https:\/\/www.amitbhawani.com\/blog\/write-adwords-ads-which-get-best-ctr-performance\/","url_meta":{"origin":8068,"position":4},"title":"Write Adwords Ads which get Best CTR &#038; Performance","author":"Amit Bhawani","date":"May 11, 2010","format":false,"excerpt":"In this Adwords Tutorial we are going to teach you with a few basic tips and ideas following which you can write better Adwords advertisements. These steps are very important because you are going to pay real money for advertising on the Google Network, hence optimizing the advertisements is really\u2026","rel":"","context":"In &quot;Google Adwords&quot;","block_context":{"text":"Google Adwords","link":"https:\/\/www.amitbhawani.com\/blog\/category\/adwords\/"},"img":{"alt_text":"Google Adwords Ad Types","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/05\/Google-Adwords-Ad-Types.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9621,"url":"https:\/\/www.amitbhawani.com\/blog\/question-answers-script-yahoo-answers-clone\/","url_meta":{"origin":8068,"position":5},"title":"Question Answers Script to Create Yahoo Answers Clone","author":"Amit Bhawani","date":"March 31, 2010","format":false,"excerpt":"Question Answers Websites have always been a hit, which is the very reason many people keep launching new ones. Yahoo! Answers being one of the biggest Answers site, is visited by millions every month and update with thousands of answers everyday. Here is a script which can be called as\u2026","rel":"","context":"In &quot;Web Tools&quot;","block_context":{"text":"Web Tools","link":"https:\/\/www.amitbhawani.com\/blog\/category\/web-tools\/"},"img":{"alt_text":"Ask Question Answerscript","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Ask-Question-Answerscript.gif?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts\/8068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/comments?post=8068"}],"version-history":[{"count":0,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts\/8068\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/media\/19570"}],"wp:attachment":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/media?parent=8068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/categories?post=8068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/tags?post=8068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}