Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1490815

    Hi,
    I am trying tom use Text and CSS to create header with any logos can you help please. I have tried to use the documentation to create a heading. Using this code in functions.php file.
    <?php
    /* LOGO – 21-05-20
    —————————————-*/
    add_filter(‘avf_logo_subtext’, ‘kriesi_logo_addition’);
    function kriesi_logo_addition($sub) {
    $sub .= ‘<div class=”logo-title”>WAYNE ANDERSON<span></span></div>’;
    $sub .= ‘<div class=”logo-subtitle”></div>’;
    return $sub;}
    ?>

    But I have two issues I need the text to be central across header and also when I delete the logo I get the enfold logo coming up as default. I have enclosed a screenshot of what I am trying to achieve with text highlighted.
    https://peter-test1.co.uk/header-example.jpg

    Many thanks.

    #1490816

    the filter avf_logo_subtext is nice to have both Logo Image and Text

    try instead:

    function use_text_logo_only($logo){
      $link = apply_filters( 'avf_logo_link', home_url( '/' ) );
      $logo_tag = "h1";
      $logo_heading = "Wayne Anderson";
      $alt = get_bloginfo( 'name' );    
      $title = get_bloginfo( 'name' );
    
      $logo = '<a class="logo text-logo" href="'.$link.'" alt="'.$alt.'" title="'.$title.'"><'.$logo_tag.'>'  .$logo_heading.'</'.$logo_tag.'></a>';
      return $logo;
    }
    add_filter('avf_logo_final_output','use_text_logo_only');

    and on quick css:
    (maybe with your header setting – you had to adjust the css a little bit )

    #top .logo.text-logo  {
      display: flex;
      justify-content: left;
      align-items: center;
      width: auto;
    }
    #top .logo.text-logo h1  {
      margin: 0 !important;
      font-size: 30px;  /* adjust to your needs */
      text-transform: uppercase !important;
    }

    PS: if you like to have different alt and title tags replace in the snippet above with hardcoded strings

    
    $alt = "your alt attribute";    
    $title = "your title attribute";
    

    and if you do not like to have a h1 – just replace to a different tag ( h2, div, span etc. ) but then you had to adjust the css to that tag

    see example page: https://webers-testseite.de/background-video/

    #1490818

    Hi,

    Thanks for helping out @guenni007. Did that answer your question @condonp?

    Best regards,
    Rikard

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