WordPress.org

Ready to get started?Download WordPress

Forums

Scrollarama CSS Hack (2 posts)

  1. flashbuddy
    Member
    Posted 3 years ago #

    I'm using Maltpress' Scrollarama at http://shanechipp.com. Love it! Ran into a glitch where a user created a post and assigned it to the category that Scrollarama draws images/text from, yet did not set a featured image! I ended up with a blank white rectangel; ugly!

    Solution: Added to my style.css

    .pr_side_slider{
    	background-image: url('path-to-your-image.jpg');
    	background-repeat: no-repeat;
    }

    Now when a post in the Scrollarama category doesn't have an image, the slider will display what I set as default. Easy peasy solution.

    On another note, adding a featured image to said post did not appear in scrollarama?! I don't know why, I tried a couple times and gave up, opting for my hack insted.

  2. maltpress
    Member
    Posted 3 years ago #

    Yep; the default is a blank box, and this hack is perfect for setting your own default background image.

    Background images are generated EITHER from a custom field called "slider" which takes an image url, or if that isn't present, from the first attachment on a post. If this attachment is a media file rather than an image, it won't work.

    Using the "slider" custom field is always the best way to add your image as it's far easier to control without affecting the image on the post.

Topic Closed

This topic has been closed to new replies.

About this Topic