{"id":366,"date":"2019-06-26T09:21:30","date_gmt":"2019-06-26T09:21:30","guid":{"rendered":"http:\/\/adsforwp.com\/docs\/?post_type=ht_kb&#038;p=366"},"modified":"2019-06-27T05:59:05","modified_gmt":"2019-06-27T05:59:05","slug":"how-to-display-the-ad-in-custom-target-by-using-jquery-selector","status":"publish","type":"ht_kb","link":"https:\/\/adsforwp.com\/docs\/article\/how-to-display-the-ad-in-custom-target-by-using-jquery-selector\/","title":{"rendered":"How to display the ad in custom target by using jquery selector"},"content":{"rendered":"<p>If you want to display the Ads by targeting name, id, classes, types, attributes, values of attributes and much more then by using our jQuery Selectors option you can easily display the ads on that targeting places<\/p>\n<p><strong>Follow these simple steps:<\/strong><\/p>\n<p>You will find this option in <strong>WordPress Dashboard<\/strong> -&gt;<strong> Navigate to Ads<\/strong> -&gt; Click on the &#8220;<strong>Add new Ad<\/strong>&#8221; button.<\/p>\n<p>First, select the Image banner Ad option and upload the image<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-391\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7.png\" alt=\"\" width=\"1053\" height=\"624\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7.png 1053w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-300x178.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-768x455.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-1024x607.png 1024w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-50x30.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-60x36.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-7-100x59.png 100w\" sizes=\"auto, (max-width: 1053px) 100vw, 1053px\" \/><\/p>\n<p><strong>Display Type:<\/strong> Select the &#8220;Custom Target&#8221; option.<\/p>\n<p><strong>Position:<\/strong> Select the &#8220;<strong>Existing html element<\/strong>&#8221; option<\/p>\n<p><strong>jQuery Selector:<\/strong> In this field, you need to add &#8220;<strong>class<\/strong>&#8221; or &#8220;<strong>ID<\/strong>&#8221; where you want to display the Ad<\/p>\n<p><strong>Action:<\/strong> In this option, there are two option &#8220;<strong>Before Element<\/strong>&#8221; or &#8220;<strong>Inside Element<\/strong>&#8220;.<\/p>\n<p><strong>Inside Element:<\/strong> If you select the Inside Element option the Ad will be displayed in below the &#8220;<strong>class<\/strong>&#8221; or &#8220;<strong>ID<\/strong>&#8220;.<\/p>\n<p><strong>Before Element:<\/strong> If you select the Before Element option the Ad will be displayed above the &#8220;<strong>class<\/strong>&#8221; or &#8220;<strong>ID<\/strong>&#8220;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-401\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1.png\" alt=\"\" width=\"868\" height=\"320\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1.png 868w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1-300x111.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1-768x283.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1-50x18.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1-60x22.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-8-1-100x37.png 100w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/p>\n<p>If you don&#8217;t want to use the &#8220;<strong>Existing html element<\/strong>&#8221; and you want to create new element then use &#8220;<strong>New html element<\/strong>&#8221; option. By using this element you can copy the given div element and you can paste it where you want to display the Ad on your website.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-411\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1.png\" alt=\"\" width=\"863\" height=\"252\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1.png 863w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1-300x88.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1-768x224.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1-50x15.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1-60x18.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/new-1-100x29.png 100w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>In this section, you need to set the condition for the specific post or page or all posts where you want to show \u201cAd\u201d like below the screenshot<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-377\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3.png\" alt=\"\" width=\"879\" height=\"165\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3.png 879w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3-300x56.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3-768x144.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3-50x9.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3-60x11.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-3-100x19.png 100w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><\/p>\n<h4>The output of the ad in the custom target by using jquery selector<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-404\" src=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6.png\" alt=\"\" width=\"1350\" height=\"657\" srcset=\"https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6.png 1350w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-300x146.png 300w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-768x374.png 768w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-1024x498.png 1024w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-50x24.png 50w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-60x29.png 60w, https:\/\/adsforwp.com\/docs\/wp-content\/uploads\/2019\/06\/ad-6-100x49.png 100w\" sizes=\"auto, (max-width: 1350px) 100vw, 1350px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n<p>We hope we\u2019ve clear your doubts in case If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<p>Or you Just contact us\u00a0<a href=\"http:\/\/www.adsforwp.com\/contact\/\"><strong>here<\/strong>\u00a0<\/a>and we are always available for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to display the Ads by targeting name, id, classes, types, attributes, values of attributes and much more then by using our jQuery Selectors option you can easily display the ads on that targeting places Follow these simple steps: You will find this option in WordPress Dashboard -&gt;&#8230;<\/p>\n","protected":false},"author":3,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[18],"ht-kb-tag":[],"class_list":["post-366","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-how-to"],"_links":{"self":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":27,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/366\/revisions"}],"predecessor-version":[{"id":412,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/366\/revisions\/412"}],"wp:attachment":[{"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=366"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/adsforwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}