• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Display ads in categories

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Display ads in categories

This topic is: resolved

Tagged: ads

  • This topic has 7 replies, 3 voices, and was last updated 9 years, 9 months ago by rammen.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • June 29, 2013 at 4:03 am #48350
    rammen
    Member

    Hi,

    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.no
    June 29, 2013 at 8:50 pm #48462
    Brad Dalton
    Participant

    Hook in a custom widget area using the conditional tag for a category:

     if (is_category('technology') ) {
    

    Change the hook position if needed.


    Tutorials for StudioPress Themes.

    June 30, 2013 at 2:51 pm #48577
    rammen
    Member

    Thanks! 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 #48593
    Summer
    Member

    The 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 Dark

    June 30, 2013 at 7:35 pm #48602
    Brad Dalton
    Participant

    You 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.


    Tutorials for StudioPress Themes.

    July 1, 2013 at 2:51 am #48637
    rammen
    Member

    Summer: 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 #48655
    Brad Dalton
    Participant

    You can tag the posts you want to display ads on and then use the conditional,

     if ( has_tag ('your_tag')  ) { 

    Tutorials for StudioPress Themes.

    July 1, 2013 at 9:17 am #48677
    rammen
    Member

    Works like a charm! Thanks for your help.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble