Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #259803

    Hi,

    I’m trying to get a line of “payment methods accepted” to go above the search box in the header but can seem to find a way to do it.

    I’ve got this image of the cards which I want to be shown: https://www.dropbox.com/s/sebpkkdfamk0gtd/Payment%20Methods%20Header.png
    ^(you need to copy the url to see it for some reason?)

    If anyone could show me how to do it, it would be much appreciated! :)

    Thanks

    Perry

    • This topic was modified 4 months ago by  PerryNewman.
    • This topic was modified 4 months ago by  PerryNewman.
    • This topic was modified 4 months ago by  PerryNewman.
    #259812

    Hey Perry!

    Try this in functions.php:

    function custom_head_func(){
    	echo "<div class='custom_content'><img src="https://www.dropbox.com/s/sebpkkdfamk0gtd/Payment%20Methods%20Header.png"></div>";
    }
    add_action('ava_main_header', 'custom_head_func');

    Additional styling may be needed, please post a link to your website after you made this change.

    Best regards,
    Josue

    #259824

    Hi,

    Thanks for the reply :) I pasted it into the top of ‘functions.php’ under ‘global $avia_config;’ and this error appeared when I saved the file?

    Parse error: syntax error, unexpected ‘http’ (T_STRING), expecting ‘,’ or ‘;’ in (website url)/wp-content/themes/replete/functions.php on line 6

    ^Currently running on ‘MAMP’ server as I’m testing it before I put it live.

    Thanks

    Perry

    #259825

    Hey!

    Put it at the end.

    Best regards,
    Josue

    #259827

    Hi,

    This time I got this error?

    Parse error: syntax error, unexpected ‘http’ (T_STRING), expecting ‘,’ or ‘;’ in (website url)/wp-content/themes/replete/functions.php on line 313

    Many Thanks

    Perry

    #259868

    Hi!

    The quote syntax just needed to be adjusted a bit:

    
    unction add_custom_header_message(){
    	echo '<div class="custom_content"><img src="https://www.yoursite.com/yourimage.png"></div>';
    }
    add_action('ava_main_header', 'add_custom_header_message');
    

    Change the url to your image as needed and then adjust the div class custom_content with your own css rules to align and style the content.

    Best regards,
    Devin

    #259897

    Hi,

    I added it into the “functions.php” file at the bottom, this time it saved without showing any syntax but the image hasn’t shown on the header? I changed the code to this:

     function add_custom_header_message(){
    	echo '<div class="custom_content"><img src="(website url)/wp-content/uploads/2014/05/Payment-Methods-Header.png"></div>';
    }
    add_action('ava_main_header', 'add_custom_header_message'); 

    the (website url) is the file directory on my MAMP server, Hopefully you can work it out :)

    Thanks

    #260007

    Hi!

    If you try accessing the image URL directly in another tab, does it work?

    Unfortunately we can’t “work it out” if you are on a localhost environment :(

    Regards,
    Josue

    • This reply was modified 4 months ago by  Josue.
    #260017

    Hi,

    And yep it shows the image as it would be on the site.

    I could possibly put it live on another domain so you could have a look, would that help?

    Thanks

    #260018

    Hi!

    It will definitely help, reply to this topic when you are done with that.

    Best regards,
    Josue

    #260022
    This reply has been marked as private.
    #260023

    Hey Perry!

    It’s added now, i was using the wrong hook:

    
    function add_custom_header_message(){
    	echo '<div class="custom_content"><img src="http://www.express-radio.co.uk/wp-content/uploads/2014/05/Payment-Methods.png"></div>';
    }
    add_action('avia_meta_header', 'add_custom_header_message');

    Added this to the Quick CSS too:

    div.custom_content {
        position: absolute;
        width: 200px;
        right: 0;
        top: 90px;
    }

    Modify as needed.

    Cheers!
    Josue

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

You must be logged in to reply to this topic.