Forums

Different ads for different categories managed by different authors (3 posts)

  1. soulsizzle
    Member
    Posted 2 years ago #

    I am developing a WordPress theme for a large organization. It will have multiple authors who are each responsible for a different category. Additionally, they will each be responsible for ads displayed within their particular category.

    What is the easiest way to implement this. Easy for the client is more important than easy for me. Ideally, when they are logged into the admin panel, they would be shielded from any ad settings that would not be directly tied to their category.

    Any help is appreciated.

  2. geggiot
    Member
    Posted 1 year ago #

    You have use

    in_category('5')
    Returns true if the current post is in the specified category id. read more
    in_category( array( 1,2,3 ) )
    Returns true if the current post is in either category 1, 2, or 3.
    !in_category( array( 4,5,6 ) )
    Returns true if the current post is NOT in either category 4, 5, or 6. Note the ! at the beginning.
    Note: Be sure to check your spelling when testing, "is" and "in" are a big difference.

    Example
    `<?php

    in_category(array( 1,2,3 )){
    echo ' cat1-2-3-banner ';
    }

    in_category(array( 4,5,6 )){
    echo ' cat4-5-6-banner ';
    }
    // this one uses page ID
    elseif in_category( array( 7,8,9 ) )
    echo ' cat7-8-9-banner ';
    }
    else {
    echo ' catbanner ';
    }
    ?>

  3. toddliebman
    Member
    Posted 1 year ago #

    I have a similiar issue: My website (www.parkingandtrafficticketinfo.com) is built with the main-pages as categories. However, I'm unable to isolate an individual category to place an ad on it. Does anyone have instructions on how to place an ad on an individual category, instead of having the same ad show up on each category?

Topic Closed

This topic has been closed to new replies.

About this Topic