Slideshow on home page only, custom category header image
Support Area › Forums › Agency › Slideshow on home page only, custom category header image
Tagged: category header images, header images, rotator, Slide Show
- This topic has 4 replies, 2 voices, and was last updated 12 years, 3 months ago by Bill Robbins.
-
AuthorPosts
-
January 16, 2012 at 04:56 #4673Joe MalikParticipant
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 MalikJanuary 16, 2012 at 11:12 #4681Bill RobbinsModeratorThat 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:
- Go to the appearance section and select edit to open up the theme editor.
- From the list of files on your right, choose archive.php and look for this spot:
<?php ot_cycle(); ?>
- Replace it with this:
- 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.
January 16, 2012 at 13:29 #4686Joe MalikParticipantHey Bill, thank you very much for your answer! I will test your solution tomorrow and let you know if I encountered any problems.
Regards
January 17, 2012 at 04:13 #4697Joe MalikParticipantI’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!
January 17, 2012 at 11:14 #4708Bill RobbinsModeratorIt 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.
-
AuthorPosts
- The topic ‘Slideshow on home page only, custom category header image’ is closed to new replies.