Slideshow on home page only, custom category header image

Support Area Forums Agency Slideshow on home page only, custom category header image

Viewing 5 posts - 1 through 5 (of 5 total)
URL to the page in question:
  • Author
    Posts
  • #4673
    Joe Malik
    Participant

    Hello everybody, I would like to know if there is the opportunity to
    1) show the Slide Show on the home page only
    and to
    2) display a custom header image on each category index page.

    I already managed to get custom page/ article header images to work which is pretty straight forward.

    Any hint or help is highly appreciated!

    Thank you for reading,
    Joe Malik

    #4681
    Bill Robbins
    Moderator

    That will actually be an option in the next version of the theme. Until I have a chance to make the update, you can make some changes on your own. This will require you to use a plugin called Taxonomy Images II which is free from the plugin repository at WordPress.org.

    Once you’ve installed and activated the plugin, you’ll need to make a change to the theme. Here’s how:

    1. Go to the appearance section and select edit to open up the theme editor.
    2. From the list of files on your right, choose archive.php and look for this spot:

      <?php ot_cycle(); ?>

    3. Replace it with this:

    4. Save your changes

    Now you’ll be able to upload an image on the Edit Category Screen that will serve as the header image for that archive.

    To be fair, I haven’t tested this, but it should work based on what the plugin says should happen.

    If you have any trouble, let me know.

    #4686
    Joe Malik
    Participant

    Hey Bill, thank you very much for your answer! I will test your solution tomorrow and let you know if I encountered any problems.

    Regards

    #4697
    Joe Malik
    Participant

    I’m sorry to say that, but it only works halfway. After installing the plugin and modifying the archive.php file, I get a broken image in return.

    The generated html code reads as follows:

    <li class="category_image term_image"><img src="" alt="myAlt"></li>

    I am using the latest WP-release. Any Idea?

    Thanks!

    #4708
    Bill Robbins
    Moderator

    It looks like the plugin may not be cooperating as much as I had hoped.

    Here’s one way you could go about this for sure. It’s not quite as user friendly to set up, but it will work.

    Instead of the code above use this:

    This makes use of WordPress’ conditional statements (http://codex.wordpress.org/Conditional_Tags) to output an image when you’re in a specific category.

    The 3 in the first line is the category id for the first category you’d like to use. The line below that is the image tag for the image you’d like to associate with that category.

    If category 3 isn’t being viewed, then it will check and see if you’re in category 2. If you are, then the second image will be displayed. If you’re not in category 2, then the slideshow will be viewed.

    You can add more of these by repeating the second section (the one with the elseif statement) and changing the category.

    There are lots of options here that you can choose from among the conditional tags in the Codex.

    This is actually how we load different background images in the Foxy theme for various sections of the theme.

    Give it a try and let me know if you have any trouble. If you need to post your code, you can enter it at http://gist.github.com and then post a link to it here.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Slideshow on home page only, custom category header image’ is closed to new replies.