I wasn't sure how to search for this, I tried but didn't get anything for habitat. Basically I wanted the main slider image, the massive one on the home page to be a static image. I didn't want it to relate to my posts, I just want to have a nice huge image on my main page that I can change maybe once a week, but not have it as a slider or anything. Also I don't want that image to be clickable, I just want it as a nice "wallpaper" for my blog. Thanks
Static slider image
19 posts from 5 voices-
Posted 9 months ago #
-
Hi gonzosan,
As far as I know there isn't any way to achieve that with the theme options as the featured image area is designed to only load in images from the posts.
What you'll need to do is edit the actual index.php file in the theme files. Look for this block of code:
<?php $additional_loop = new WP_Query($query_string); #counts the post iterations $counter = 1; if ($additional_loop->have_posts()) : while ($additional_loop->have_posts()) : $additional_loop->the_post(); $more = 0; # get the feature image/video by calling the function in display_feature_media.php file, display it if its a Big Image/ Video # or save it to the var $medium_prev_image if its a small one to display it within the post, not above the post $medium_prev_image = display_featured_media($counter); if( $counter == 1 ) echo "<div class='content'>"; ?>Edited for correct procedure :) - Add the following just before it but after the main div.
<ul class='slideshow slideshowBig featured_container1' ><li class='featured featured_container1' ><span title='' ><img src='http://yourwebsite.com/yourimage.png' alt='slider_half' title='slider_half' /></span></li></ul><div class='content'>Then replace the yourwebsite.com/yourimage.png with the url for your image. Just make sure that the image used is 850x400 to fit the space.
The last step is to go into your theme settings and set the Slideshow Options>Featured Image Option to "All Entries with small Pictures".
Regards,
Devin
Edit: This has been updated following the below issues. The other fixes are no longer needed.
Posted 9 months ago # -
Awesome thanks! I'll try it out tonight when I get off work. thanks for the quick reply.
Posted 9 months ago # -
Hey!
Please report back if it works or not.
Best regards,
PeterPosted 9 months ago # -
Alright when I tried it, I got this "Parse error: syntax error, unexpected T_ENDWHILE in /home/gonzosan/public_html/wp-content/themes/habitat/index.php on line 89"
I'm not sure if I missed anything or not the link I used was this:
http://burningtoday.com/wp-content/uploads/2012/07/PItrees.jpgI'm not very good with PHP, so if you could tell me what I did wrong I'd appreciate it. Thanks
Posted 9 months ago # -
Can I please get some help with this?
Posted 9 months ago # -
Hi gonzosan,
Open your index.php and remove this line of code:
endwhile; else:also, remove this line of code:
endif;
Hope this helps. :)Cheers,
IsmaelPosted 9 months ago # -
Awesome, thanks for the help all. I'll try it when I get home from work and let you know if it works.
Posted 9 months ago # -
Hi gonzosan,
Great! just update us, once you have done it. :)
Regards,
IsmaelPosted 9 months ago # -
Well it works, kind of, but messes up some other things. First off the image (850 by 400) seems really small for the space. It just looks like it's sitting in the middle. I'd like it to completely line up with the sides of the main body. Also the biggest issue is that it doesn't show any of my blog posts once I edit the file. It'll show the image, then the title of my last blog post and underneath it says "Nothing found". I have at least 5 posts. Not sure why this isn't working. I don't mind having a slider as long as it works off image I put in myself, not dependent on the images from my blog posts. Thanks.
Posted 9 months ago # -
Hi gonzosan,
Can you provide a link that has the issue? or a screenshot of the issue? but we would like to prefer if its a link so we can check it further. :)
Regards,
IsmaelPosted 9 months ago # -
I'll leave it up when I go to bed tonight after work. I don't like it keep it like that for long since I won't be able to fix it until later tonight. Thanks
Posted 9 months ago # -
Hi gonzosan,
Okay, we'll just wait for you to post the link or provide a screenshot. :)
Regards,
IsmaelPosted 9 months ago # -
I'm having the same issue.
Here is a screenshot of the site working correctly before the removal and addition of the code above: http://cl.ly/image/0b1O0F033Q3u
Here is what the code does: http://cl.ly/image/2Q2W2B2o010m
Best,
BrandonPosted 8 months ago # -
Hi Brandon,
I was to hasty in my original fix. A much more simple approach is to go into your theme settings and set the Slideshow Options>Featured Image Option to "All Entries with small Pictures". Then, add the straight html static image above the start of the loop. So right after the div id=main you'll add it in and it will look like the following:
<div id="main"> <ul class='slideshow slideshowBig featured_container1' ><li class='featured featured_container1' ><span title='' ><img src='http://yourwebsite.com/yourimage.png' alt='slider_half' title='slider_half' /></span></li></ul><div class='content'> <?phpNOTE: The above code has the starting div and the start of the php to illustrate where the list with your image will go. Make sure you either just put in the code in between those elements or replace them exactly with the above and keeping everything before and after them the same.
Regards,
Devin
Posted 8 months ago # -
Everything works expect the sidebar is not on the side... I left it up for you to see: http://www.lindagodsey.com.
Posted 8 months ago # -
Strange that I didn't get this when I tested it, but you just need to remove the end content class on the unordered list that holds the now static slideshow. I've update the code above but here it is again:
<ul class='slideshow slideshowBig featured_container1' ><li class='featured featured_container1' ><span title='' ><img src='http://yourwebsite.com/yourimage.png' alt='slider_half' title='slider_half' /></span></li></ul>Regards,
Devin
Posted 8 months ago # -
That did it! Thank you!
Posted 8 months ago # -
Hey,
Glad it is fixed. :)
Regards,
IsmaelPosted 8 months ago #
Topic Closed
This topic has been closed to new replies.














