Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #484233

    Hi,

    I found this thread because my client wants a button in the same postition: https://kriesi.at/support/topic/how-can-a-add-a-hyperlinked-image-at-the-top-of-my-newscast-blog/
    I tried improvising to make it work, and I’m stuck. Here’s the code I added to header.php (inline to show position):

    <?php
    global $avia_config;

    $style = $avia_config[‘box_class’];
    $responsive = avia_get_option(‘responsive_active’) != “disabled” ? “responsive” : “fixed_layout”;
    $blank = isset($avia_config[‘template’]) ? $avia_config[‘template’] : “”;
    $av_lightbox= avia_get_option(‘lightbox_active’) != “disabled” ? ‘av-default-lightbox’ : ‘av-custom-lightbox’;
    $preloader = avia_get_option(‘preloader’) == “preloader” ? ‘av-preloader-active av-preloader-enabled’ : ‘av-preloader-disabled’;

    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?> class=”<?php echo ” html_{$style} “.$responsive.” “.$preloader.” “.$av_lightbox.” “.avia_header_class_string();?> “>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />

    <!– page title, displayed in your browser bar –>
    <title><?php if(function_exists(‘avia_set_title_tag’)) { echo avia_set_title_tag(); } ?></title>

    <?php
    /*
    * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives
    * located in framework/php/function-set-avia-frontend.php
    */
    if (function_exists(‘avia_set_follow’)) { echo avia_set_follow(); }

    /*
    * outputs a favicon if defined
    */
    if (function_exists(‘avia_favicon’)) { echo avia_favicon(avia_get_option(‘favicon’)); }
    ?>

    <!– mobile setting –>
    <?php

    if( strpos($responsive, ‘responsive’) !== false ) echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>’;
    ?>

    <!– Scripts/CSS and wp_head hook –>
    <?php
    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */

    wp_head();

    ?>

    </head>

    <body id=”top” <?php body_class($style.” “.$avia_config[‘font_stack’].” “.$blank); avia_markup_helper(array(‘context’ => ‘body’)); ?>>

    <?php

    if(“av-preloader-active av-preloader-enabled” === $preloader)
    {
    echo avia_preload_screen();
    }

    ?>

    <div id=’wrap_all’>

    <?php
    if(!$blank) //blank templates dont display header nor footer
    {
    //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
    get_template_part( ‘includes/helper’, ‘main-menu’ );

    } ?>

    <div id=’main’ data-scroll-offset='<?php echo avia_header_setting(‘header_scroll_offset’); ?>’>

    <?php do_action(‘ava_after_main_container’); ?>

    The image appears above the header, but if I try to copy/paste the css you used in the example above, the image disappears (or ends up behind the header). I’m a novice with CSS, so I don’t know what I’m doing wrong. Thanks.

    #484374

    You can add images to a menu item from the appearance>menus without having to use any (or much css).

    Use Links rater than Page. URL will be your application page. LINK TEXT will be the image you want to use <img src="http://www.imageurlhere.com" />

    That will add the image straight into the menu as clickable. A little css would be needed to make the image the correct size but this would be far easier than copying and pasting php.

    Hope that helps a little :)

    Tim

    #484375

    Hi RunningDogMedia,

    Maybe you could try the following instead? http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/. We’ll help you out with positioning once you have added the widget.

    Best regards,
    Rikard

    #484625

    Hi Rikard,

    I didn’t search for “widgets” so I didn’t find this post – thank you! I’ve got the placement set, and modified the % in CSS to move it to the desired location. Do I need to add any further code to make it clickable? I added a text widget with an ahref element, but it isn’t clickable. Thank you!!

    #485022

    Hi,

    Sorry for the late reply, please try the following CSS in Quick CSS:

    #text-3 {
        z-index: 10000 !important;
    }

    Regards,
    Rikard

    #485033

    That’s it. Thank you!!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add a clickable image in the header’ is closed to new replies.