Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #14859

    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

    #85188

    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 850×400 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.

    #85189

    Awesome thanks! I’ll try it out tonight when I get off work. thanks for the quick reply.

    #85190

    Hey!

    Please report back if it works or not.

    Best regards,

    Peter

    #85191

    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.jpg

    I’m not very good with PHP, so if you could tell me what I did wrong I’d appreciate it. Thanks

    #85192

    Can I please get some help with this?

    #85193

    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,

    Ismael

    #85194

    Awesome, thanks for the help all. I’ll try it when I get home from work and let you know if it works.

    #85195

    Hi gonzosan,

    Great! just update us, once you have done it. :)

    Regards,

    Ismael

    #85196

    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.

    #85197

    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,

    Ismael

    #85198

    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

    #85199

    Hi gonzosan,

    Okay, we’ll just wait for you to post the link or provide a screenshot. :)

    Regards,

    Ismael

    #85200

    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,

    Brandon

    #85201

    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'>

    <?php

    NOTE: 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

    #85202

    Everything works expect the sidebar is not on the side… I left it up for you to see: http://www.lindagodsey.com.

    #85203

    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

    #85204

    That did it! Thank you!

    #85205

    Hey,

    Glad it is fixed. :)

    Regards,

    Ismael

Viewing 19 posts - 1 through 19 (of 19 total)

The topic ‘Static slider image’ is closed to new replies.