• I am looking for a way to let the header image change based on page or post -but- in a slightly different way then usually asked for.

    Example:
    Page/Post A – Header Image A is shown
    Page/Post B – Header Image B is shown
    Page/Post C – Header Image C1, C2 or C3 is randomly shown
    Page/Post D – Header Image D is shown
    Page/Post E – Header Image E1, E2, E3 or E4 is randomly shown

    Is there any way to do that?

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

    (@webber2012)

    I managed to get it done for the most part but I now would like to have random images shown.

    It works with a single image but when I want it to show random images I don’t get it to work.

    Example of what works:

    <?php if(is_page('Page title')){ echo '<img src="/imageA.jpg" />'; } ?>

    Example of what I am after:

    <?php if(is_page('Another page title')){ echo '<img src="/image-<?php echo rand(B,C; ?>.jpg">'; }

    What above needs to do is load randomly imageB.jpg or imageC.jpg This doesn’t happen now because in the url you can see that the code after image- is being rendered wrong, so it can’t find the image.

Viewing 1 replies (of 1 total)
  • The topic ‘Different header image(s) depending on page but slightly different’ is closed to new replies.