Community Forums › Forums › Archived Forums › General Discussion › Using backstrech
Tagged: backstrech, outreach, stretch
- This topic has 8 replies, 3 voices, and was last updated 12 years, 2 months ago by
pauldewouters.
-
AuthorPosts
-
December 30, 2012 at 11:06 am #8390
iaditya999
MemberI am using outreach theme....
Following briangardner.com for long time...Before some time he was with minimum theme but then he changed his blog theme to stretch theme (
which is available on studiopress)In that theme he has used backstrech code for the background of the blog....
Actually I was working with my inner section from style.css.....Changing only inner background from my theme using backstrech.....
I have searched for it and found some scripts and code but I am unable to incorporate with it , where to add the code and what about css ????
It would be great if someone explains it into detail so I can experiment in various parts of my web.....
December 30, 2012 at 5:13 pm #8469cdils
ParticipantHi there,
Can you post a link to your site so I can see what you currently have?
Cheers,
Carrie
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
December 30, 2012 at 11:32 pm #8535iaditya999
Member<a href="http://imgur.com/DFukh"><img src="http://i.imgur.com/DFukh.png" alt="" title="Hosted by imgur.com" /></a>
December 31, 2012 at 11:14 am #8606cdils
ParticipantThe Stretch theme is calling in the background stretch scripts from functions.php. The actual styling is taking place in stylesheet.css.
What are the "scripts and code" you have found? Are they from the original Stretch theme?
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
December 31, 2012 at 11:30 am #8608iaditya999
MemberI founded here
https://github.com/srobbin/jquery-backstretch ....
What should I do to make it work as I said in the problem????
December 31, 2012 at 6:09 pm #8646cdils
ParticipantThere's basically three components:
Add the javascript files to your site.
Call in those scripts via your site's functions.php
Add in custom styling for your featured slider in stylesheet.css1. You'll need to download backstretch.js and include it with your theme files - upload it to wp-content/themes/minimum/js or wherever you want. There's an additional script used in Stretch called backstretch-set.js. Here's a link for that code: https://gist.github.com/4424049.
2. From there you'll need to call those scripts in via your theme's function.php file. Here's an example of how it's being called in from the Stretch theme:
/** Load Backstretch script and prepare images for loading */
add_action( 'wp_enqueue_scripts', 'stretch_enqueue_scripts' );
function stretch_enqueue_scripts() {
wp_enqueue_script( 'stretch-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0', true );Â Â Â Â ÂÂ Â Â Â wp_enqueue_script( 'stretch-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'stretch-backstretch' ), '1.0.0', true );
}/** You'll need to customize this bit below**/
add_action( 'genesis_after_post', 'stretch_set_background_image' );
function stretch_set_background_image() {$image = array( 'src' => has_post_thumbnail() ? genesis_get_image( array( 'format' => 'url' ) ) : genesis_get_option( 'stretch_default_image' ) );
wp_localize_script( 'stretch-backstretch-set', 'BackStretchImg', $image );
}Make sure the file path in the function above matches wherever you added backstretch.js and backstretch-set.js. There a function in the the Minimum theme's function.php called
function
minimum_featured_image()
and that's where your featured slider is probably being called in (unless you've customized it a different way). You'll need to modify that function to mimicfunction
stretch_set_background_image().
3. Lastly, you'll need to apply some CSS to your theme's stylesheet.css for those divs containing your featured slider. Keep in mind the Stretch theme is using a static image versus a slider, so there will be some differences.
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
January 2, 2013 at 10:00 am #8947iaditya999
Memberi have been working for this two days since...But failing many times....
$image = array( ‘src’ => has_post_thumbnail() ? genesis_get_image( array( ‘format’ => ‘url’ ) ) :
here what to add between src ,format and url ???
would you please rather provide more specific way related to outreach theme....
January 2, 2013 at 10:55 am #8961cdils
ParticipantHi, I'm not sure where to go from here. Let me see if I can get someone to help.
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
January 2, 2013 at 1:32 pm #9006pauldewouters
Member -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.