Before you ask please READ THIS

Replace icon for each page...

edited June 2014 in Beach Please Posts: 21
Hi,

I just bought your awesome theme and wondered if there is a way to replace icon in the menu by a image file (png or jpg).

if by that way i could add some code instead of the name of the icon in the page "menu icon" field... that would be nice !
i already checked the forum and i didn't find antyhing to guide me.

Thank you again for that theme.
Regards from a small french island called Reunion Island.

Olivier.

Comments

  • AirAir
    Posts: 10,970
    Hello there:-)
    Palm0live974 said: replace icon in the menu by a image file (png or jpg).
    This can not be done by panel. However to each position in menu you can write custom CSS that will position small background image there. Every item in menu has its own class so this way you can achieve it;-)
    Palm0live974 said: f by that way i could add some code instead of the name of the icon in the page "menu icon" field... that would be nice !
    You can insert there code, but then you will have to edit menu walker so it will display your code, I assume you mean HTML.

    Go to advance/utilities.php line ~752 and remove this:
    
                $icons = explode(' ', $menu_icon);
                $menu_icon = '';
                foreach($icons as $icon){
                    if(strlen($icon)){
                        if($new_icons){
                            $menu_icon .= '<i class="fa '.esc_attr( $icon ).'"></i>';
                        }
                        else{
                            $menu_icon .= '<i class="'.esc_attr( $icon ).'"></i>';
                        }
                    }
                }
    
    or in some case it can be better to change above code to:
    
    $menu_icon = '<i>'.$menu_icon.'</i>';
    
    With regards.
  • Thank you for that nice answer !

    actually i found a greater solution... i just turned my png file in .svg format (exporting from illustrator), so my png become a font, and i can call it from each page.

    It's very nice this way, as soon as my site is ready, i'll share it on the topic "show your beach" ;)

    I have an other request !

    Concerning "my works" edit possibilities... would it be possible to put an icon in the custom info 1, custon info 2....
    actually i'd like to put an icon and some pdf file to be downloaded.

    i'm not so friendly with custom field management...

    Thank you for your support !


  • AirAir
    edited June 2014 Posts: 10,970
    Hello:-)

    That is great how you solved this:-)

    It would be nice if you would start new topic for your new question. Why? Read more here. Meanwhile I will think about answer for you.

    --EDIT
    Answer: So all of this you can do currently: just insert such code in your custom info field to see results:
    <i class="fa fa-medkit"></i> : http://apollo13.eu

    With regards.
    Post edited by Air on
  • that solution is perfect, thank you.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!