I want to change the background in the landing page template

Community Forums Forums Design Tips and Tricks I want to change the background in the landing page template

This topic is: resolved

This topic contains 5 replies, has 3 voices, and was last updated by  braddalton 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #71785

    lflier
    Participant
    Post count: 11

    I am using the custom background feature in the Minimum Pro theme on my own website, which is in the development stage. The main background works very nicely for the front page, but I need a different background on my landing pages.

    Minimum Pro has a Javascript feature that resizes the background along with the page. I would like this feature on my landing pages, too. So my question is whether I can modify the landing page template to use a different background, or somehow trick or modify the Javascript to load a different background for any page that uses the landing page template.

    This appears to be the code in the template that calls the custom background:

    //* Enqueue Backstretch scripts
    add_action( 'wp_enqueue_scripts', 'minimum_enqueue_backstretch' );
    function minimum_enqueue_backstretch() {
    
    	//* Load scripts only if custom background is being used
    	if ( ! get_background_image() )
    		return;
    	
    	//* Load Backstretch scripts
    	wp_enqueue_script( 'minimum-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'minimum-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'minimum-backstretch' ), '1.0.0' );
    	wp_localize_script( 'minimum-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) );
    
    }

    I’ve searched the forums, but I’ve found nothing that I am able to work with. I’m comfortable hacking PHP and Javascript, but I have no formal training. Thanks in advance for your help.

    • This topic was modified 11 months, 3 weeks ago by  lflier.
    • This topic was modified 11 months, 3 weeks ago by  lflier.
    #71808

    lflier
    Participant
    Post count: 11

    I may have found the answer to my question in this plugin, which has the page behaving as I want:

    http://wordpress.org/plugins/custom-background-extended/

    #71815

    braddalton
    Participant
    Post count: 10263
    #72466

    lflier
    Participant
    Post count: 11

    Awesome! Thank you.

    #92029

    nglstudios
    Participant
    Post count: 13

    Good Day,
    I have somewhat the same question, is it possible to have a background for different landing pages?
    Like if I set a feature image in that landing page to use that as a background.

    #92063

    braddalton
    Participant
    Post count: 10263

    Yes. You can choose from a range of plugins or use conditional tags with the code to add a custom body class otherwise use the page i.d for each landing page.


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

You must be logged in to reply to this topic.