WordPress.org

Ready to get started?Download WordPress

Forums

Scrollarama
Move Title / Text to Top? (2 posts)

  1. sdwhipid
    Member
    Posted 3 years ago #

    Is it possible to move the title and the exerpt to the top of the container and not have it over lap the background image? Also, is there way to bring the background images (the slides) to the front so that they can be stylized in CSS as img?

    http://wordpress.org/extend/plugins/scrollarama/

  2. maltpress
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    This isn't something I thought of doing - to be honest I wrote the plugin for a site I was working on and thought I'd release it into the wider world if anyone else needed it, so it kind of just does what I needed it to at the moment!

    You can do it yourself if you want to play with the code, though - it should be reasonably easy to get it doing what you want.

    There are two functions in scrollarama.php you'll need to amend; pr_determineBackground(); on line 39 and pr_showPosts(); on line 95.

    The first, pr_determineBackground(); looks at whether a post has an attachment or something in the "slider" custom field; if it does, it creates a string called $background which has the CSS for the image, for example if it's from the "slider" custom field:

    $background = "url(" . get_post_meta($looped_ID, 'slider', true) . ") center no-repeat;";

    You can change this to output <img> tags:

    $background = "<img src='" . get_post_meta($looped_ID, 'slider', true) . "' />";

    The pr_showPosts(); function is what creates the little loop to show the posts; amend this to call the pr_determineBackground(); function when you want to output your image, and change any css classes etc as you see fit. As long as this loop is within the div with the class pr_side_slider the cycle should work.

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic