Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Replace image on several pages with PHP or CSS?

Discussion in 'Misc WordPress Requests' started by RossMitchell, Mar 8, 2018.

  1. RossMitchell

    Guest

    Reply To: Replace image on several pages with PHP or CSS?, by RossMitchell

    You could run a filter that recognizes when the “body” is for class “page-id-37” and in this case do a text replacement on the image name. But I don’t like this technique at all.

    A better way is to get rid of the slider, and instead set background images on the div with id of “herowrap”, so in your customizer > additional css, you would have
    for your regular pages, and a selector running off the body class for the specials:

    #herowrap {
    background-image: url("https://holdersecurity.com/wp-content/uploads/2016/08/holders-slider-template-1.png");
    }
    .page-id-37 #herowrap {
    background-image: url("https://holdersecurity.com/wp-content/uploads/2018/03/holders-slider-template-2.jpg");
    }

    Your big block of html in your original post would become:

    <div id="herowrap">
    </div>

    Reply To: Replace image on several pages with PHP or CSS?
     
    #1

Share This Page

Monarch Social Sharing Plugin