[Resolved] Banner on [wp_head] hook to be centered

Home Forums Support [Resolved] Banner on [wp_head] hook to be centered

Home Forums Support Banner on [wp_head] hook to be centered

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #227107
    Jorge

    Hi Tom,

    I would like the banner I placed on [wp_head] GP-hook to be displayed centered. Now, it’s shown aligned-left, no matter what I edit!

    Please visit http://www.chorizosibericos.es to check.

    Thanks once again,

    Jorge

    #227128
    Jamal

    Hi

    You can enclose your banner like this

     <div class="div-centered">
    YOUR BANNER
    </div>

    Then the following css

    .div-centered {
        text-align: center;
    }

    I think that should work.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #227341
    Jorge

    Hi Jamal,

    Thanks for your suggestion. I’m afraid I would need somo more advice on what you mean by ‘enclosing’. My fault, for I didn’t specify which plugin I’m using: Soliloquy Lite

    I presume I am to enclose it into CustomPHP, but how do you think I should do it?

    Many thanks.

    #227379
    Jamal

    Hi

    By enclose i meant put it inside a div. Just replace “YOUR BANNER” with the shortcode you were using and then add the css. That is it, sorry if i confused you by using the wrong terminology.

    On a side note, see Tom’s advice on using wp_head hook for other things than scripts.

    Please don’t hesitate to ask if you would like more clarifications.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #227521
    Jorge

    Thanks again,

    Let me tell you what I did:

    I added CSS in Simple CSS plugin:

    .div-centered {
        text-align: center;
    }

    I introduced the code you provided in Simple PHP plugin, replacing “YOUR BANNER” with the appropiate plugin shortcode:

    <div class="div-centered">
    [soliloquy id="322"]
    </div>

    I first introduced it before the closing PHP tag “?>”, but got an error. Then placed it right afterwards, and this is the result: http://www.chorizosibericos.es

    I must be doing something wrong. Please, pardon my inability in terms of code, but I’m afraid I have to ask for your advice once more πŸ™‚

    Thanks so much.

    #227534
    Jorge

    You may now see a confusing setup; WordPress seems to be undergoing issues with uploading/retrieving the images from the library. As for now, I’m not able to upload or access to them. Let’s wait till WP comes back to normal, I’ll keep you posted πŸ™‚

    #227568
    Jorge

    Not WP issues, seems I’m having trouble with Javascript or something. Let me come back to you as this is solved, whether to go on with the thread or to communicate what the problem was, to whom might be interested.

    Please, pardon this inconvenience.

    #227609
    Jamal

    It’s not an inconvenience at all, i’m more than happy to help. Put the code directly in the before header hook, no need for Simple PHP plugin. This is how it should look like unless you had some other code there previously.

    http://www.zimagez.com/zimage/screenshot-2016-09-19-082327.php

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #228159
    Jorge

    Hi Jamal,

    Everything’s back to normal, and you were outright spot on:

    I added this CSS in Simple-CSS plugin:

    .div-centered {
        text-align: center;
    }

    Introduced this code in [Before Header] hook:

    <div class="div-centered">
    [soliloquy id="397"]
    </div>

    And the banner is now displayed perfectly centered, no issues whatsoever: http://www.chorizosibericos.es

    All trouble was due to my blunder when placing the code in the wrong place. Talked to Soliloquy Plugin owners, they offered to kindly test any conflict between plugins, and Custom-PHP turned out to generate issues with Soliloquy. But that wasn’t actually it, but my confusion with the code I had introduced in it.

    My apologies, you were obviously right from the very beginning. Thanks so much, I very much appreciate your so kind attentions πŸ™‚

    Best,

    Jorge

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.