Community Forums › Forums › Archived Forums › General Discussion › Display ads in categories
Tagged: ads
- This topic has 7 replies, 3 voices, and was last updated 12 years, 7 months ago by
rammen.
-
AuthorPosts
-
June 29, 2013 at 4:03 am #48350
rammen
MemberHi,
I want to display specific ads in specific categorie-pages. Let's say a viewer click on "technology" and it shows all the articles related to technology. I then want to display a ad after, lets say three expert articles, that is related to technology. How can i do that? Do i need to add something in functions.php?
I use genesis featured widget amplified to solve this in my main page, but how can i do it in categorie-pages?

Im thankful for any help i can get.
http://www.finanssans.noJune 29, 2013 at 8:50 pm #48462Brad Dalton
ParticipantHook in a custom widget area using the conditional tag for a category:
if (is_category('technology') ) {Change the hook position if needed.
June 30, 2013 at 2:51 pm #48577rammen
MemberThanks! That worked. But I still don't get ads to only appear after post #3. When i use genesis_after_post the ads display after all posts.. I only want it to display after posts #3.
Do i need to add something in this line: if (is_category('technology') && is_active_sidebar( 'custom-widget' ) ) { ?
June 30, 2013 at 6:19 pm #48593Summer
MemberThe way I got something similar to work was to have 2 instances of Genesis Featured Posts Amplified, using the offset.
So in the sidebar that Brad's code created, you'd have something like this:
Genesis Featured Posts Amplified widget (showing only 3 posts)
Text Widget (containing the code for your ad)
Genesis Featured Posts Amplified widget (same config as first GFWA, but offset by 3 posts)
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkJune 30, 2013 at 7:35 pm #48602Brad Dalton
ParticipantYou can do this and i have answered a question similar to yours before about how to do this which involves adding a variable to the code. Just can't find it at the moment.
July 1, 2013 at 2:51 am #48637rammen
MemberSummer: I use that method at the front page. But my problem in categories-page is that it automatically show the last 6 posts in that category, and then the amplified widget on top of that. I know how i can adjust how many post there is in categories, but how can i remove it, and let genesis featured post amplified do all the work?
I also wondering about how i change the widget text. If i am going to use this method, i need different names for all the categories. Now it is "Custom Widget".
Braddalton: If you find the variable, please let me know. It makes is so much easier.
Again, thanks for all the help!
July 1, 2013 at 7:09 am #48655Brad Dalton
ParticipantYou can tag the posts you want to display ads on and then use the conditional,
if ( has_tag ('your_tag') ) {
July 1, 2013 at 9:17 am #48677rammen
MemberWorks like a charm! Thanks for your help.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.