Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1011206
    scotshurdler
    Participant

    Hi Folks,

    I’ve attached a picture showing a password protected page and i wonder if above where says password protected etc, is it possible to insert an image banner we’ve made?

    #1011209
    scotshurdler
    Participant
    This reply has been marked as private.
    #1011340
    scotshurdler
    Participant
    This reply has been marked as private.
    #1011390
    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! Please add the following code in your Customizer via Appearance > Customize > Custom > Edit Global CSS:

    .post-password-form p:first-child {
        background-image: url('//testsitetestground.com/wp-content/uploads/2016/02/summerside-logo-length.png');
        padding: 100px;
    }

    And then add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	$('.post-password-form p:first-child').html('');
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1012580
    scotshurdler
    Participant

    Thanks guys, i uploaded the actual graphic to media folder and when i use the url for that in place of the url you’ve used there, the picture actually disappears all together but there looks to be a space as if something is there.

    Many Thanks

    Neale

    #1012602
    Lely
    Moderator

    Hello Neale,

    Please update your custom CSS to this:

    .post-password-form p:first-child {
        background-image: url('http://testsitetestground.com/wp-content/uploads/2016/05/Summerside-Gallery.jpg');
        padding: 170px;
        background-position-x: center;
        background-position-y: 64%;
    }

    Feel free to adjust the values accordingly.

    Hope this helps.

    #1012668
    scotshurdler
    Participant

    Ahh brilliant, thanks guys! Last question relating to that i promise, playing around with the values I see that i can position it differently, in terms of scaling the image down is there a value i can use for that?

    #1012672
    scotshurdler
    Participant

    Scratch that, did a little digging and found the background size command which allows me to expand and contract the image.

    Thanks for all your help!

    Neale

    #1012708
    Rahul
    Moderator

    You are welcome!

    #1069703
    scotshurdler
    Participant

    I’ve just noticed on mobile view, this image repeats around 3 times on my screen, how would we make that only show once like on the desktop/laptop?

    Many Thanks

    N

    #1069724
    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    @media (max-width: 480px){
        .post-password-form p:first-child {
            background-repeat: no-repeat;
            background-position-y: 50%;
        }
    }

    Hope it helps 🙂

    #1071420
    scotshurdler
    Participant

    Seems to do the trick!

    Many Thanks,

    N

    #1071447
    Christian
    Moderator

    You’re welcome. Glad we could help. 🙂

    #1071586
    scotshurdler
    Participant

    Apologies, one more question came up on this, I’ve added a second password protected page, which automatically displays the image from the first one. Is there a way to allocate an image specifically to that second page titled “newsletter”?

    Kind Regards,

    N

    #1071676
    Christian
    Moderator

    Please get your newsletter’s page ID class (see https://community.theme.co/kb/how-to-locate-post-ids/) then duplicate the previously given code and append the class like so

    .page-id-1755 .post-password-form p:first-child {
        background-image: url('URL of image');
    }

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1011206 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>