• Resolved websydaisy

    (@websydaisy)


    This was working for ages, and now for some reason, it has stopped working, and I cannot for the life of me tell why.

    On this site: https://annemarieobrienauthor.com/

    We have two blog categories that we style differently: “Dog Reads” and “World Reads.” The best way to tell is by the banner on the top of the page. “Dog Reads” has a banner with dogs in it, “World Reads” should have a banner with Worlds in it, and all other categories have no banner at all.

    “Dog Reads” is working perfectly. All other categories are working perfectly. But the archive page for “World Reads” is styling just like “Dog Reads”.

    https://annemarieobrienauthor.com/category/dog-reads/

    https://annemarieobrienauthor.com/category/world-reads/

    Here’s my conditional code, displaying a different banner depending on the category:

    <?php if ( is_category('Dog Reads') || in_category( 'Dog Reads' ) || post_is_in_descendant_category( 4 ) ) {
            echo '<div class="dogbanner"><img src="https://annemarieobrienauthor.com/wp-content/themes/BORZOI/images/dogbanner.jpg"/></div>';
        }
        elseif ( is_category('World Reads') || in_category( 'World Reads' ) || post_is_in_descendant_category( 3 ) ) {
            echo '<div class="dogbanner world"><img src="https://annemarieobrienauthor.com/wp-content/themes/BORZOI/images/worldbanner.jpg"/></div>';
        } else {
            echo ('');
        }
    ?>

    Note that subcategories of World Reads look exactly like they should: https://annemarieobrienauthor.com/category/world-reads/countries/uganda/

    As do single posts of World Reads: https://annemarieobrienauthor.com/2015/07/q-a-with-shenaaz-g-nanji-child-of-dandelions/

    It’s just the main archive page for World Reads that is showing the wrong banner (among other things, but if I can figure out why the banner is wrong I can figure out everything else):
    https://annemarieobrienauthor.com/category/world-reads

Viewing 1 replies (of 1 total)
  • Thread Starter websydaisy

    (@websydaisy)

    I seem to have fixed it but I’m sorry that I am not sure how I fixed it.

Viewing 1 replies (of 1 total)
  • The topic ‘Issue styling specific category archive page’ is closed to new replies.