• Hi.

    I am new to all this ?? So i have few questions..
    Slider is working fine for me on the front page. I know it is possible to apply slider or just static image (just one image in slider) on all pages.
    But is it possible to apply different images to different pages? Therefore on home pages I would have different image than on about page… Maybe something with different categories?
    I could also add just one static image at the end on header.php – that would show this one image on all pages. But there is now way to add different image on each page…?

    Thank you for answwers ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Silkalns

    (@silkalns)

    For that you can use conditional tags. You can read more about theme here.

    Here is a basic example how you can use conditional formating to target specific page title, id or even page slug. So you can place whatever image you want on any page you want via header.php file.

    <?php
    if (is_page( 'Front Page' ) ) { // page title
    	echo '<img src="https://image1.jpg" alt="alt text">';
    }
    elseif (is_page('44')) { // page id
    	echo '<img src="https://image2.jpg" alt="alt text">';
    }
    elseif (is_page('about-me')) { // page slug
    	echo '<img src="https://image3.jpg" alt="alt text">';
    }
    else {
    	echo '<img src="https://colorlib.com/wp/wp-content/uploads/sites/2/colorlib-logo-top.png" alt="">';
    }
    ?>
    Thread Starter anoukgo

    (@anoukgo)

    thank you. it works now. ??

    But there is another question related to this…

    there is my site, it will be easier to follow my question https://gaprodesign.si/vaja/
    For my main menu I choose pages and categories. For example: ‘O meni’ and ‘Kontakt’ are created as pages, because there are static information, ‘Aktualno’, ‘Moje delo’ and ‘Sporo?ila za javnost’ are created as categories, because here you will add post and assign it category and it will show in each category… so to get header image work I change is_page to is_category and it works. so far is everything ok.:)
    but when I click on post, to read the whole post I loose header image.
    how can I add header image for every post in every category…?

    Theme Author Silkalns

    (@silkalns)

    In this case you can use in_category

    Let me know if this helps.

    Thread Starter anoukgo

    (@anoukgo)

    Hi.
    That is working now! Thank you.

    But I have another question. On my Category page there are posts, like list of posts with short content, and than you click on post and you can read the whole content.

    Is it possible to show images that are included in posts on category page, next to short content?

    Thread Starter anoukgo

    (@anoukgo)

    I included post-thumbnails (feature image) and set display:none for single post, so I cant see feature image in my post.

    But when I did this the width of text next to the thumbnail got smaller and the button ‘continue reading’ is in same line…
    I want to have thumbnail (150px x 150px) and than text full width and button under it like in case there is no image…

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘slider or static image on all pages’ is closed to new replies.