WordPress.org

Ready to get started?Download WordPress

Forums

Custom Community
[resolved] Header Image has no meta (4 posts)

  1. pglove
    Member
    Posted 11 months ago #

    When I scan my site with the nibbler site tester website it reveals that my header logo has no alt text or dimensions set.

    I can't figure out where to put changes in my sub-theme header.php.

    I want to set my header as h1 and retrieve the width & height of the header logo, ideally alt text too if possible, using php calls like it does in the 2012 theme.

    Unfortunately I can't seem to get my head around the CC header file.

    Any help with this much appreciated :)

  2. konradS
    Member
    Posted 11 months ago #

    have a look in core/includes/theme-generator/theme-generator.php

    there you can find the header logo function.

    search for "header_logo" throughout the theme.

    The clean way would be to make a child theme,
    with a blank functions.php and then simply use remove_action (google for it;) to remove the function "header_logo" from the related action hook.

    write your own logo function with the html inside as you like.
    You can simply copy and modify our logo function and change to your HTML.

    Then hook the function via an add_action to the new place you like the logo to be.

    hope this was some useful hint!

    you'll have some stuff to learn and google and lookup in the wordpress codex. ;)

    have a great weekend, konrad

  3. pglove
    Member
    Posted 11 months ago #

    Thanks konrad, I still have tons to learn about php, but have successfully implemented a child theme with a functions file. It's very useful knowing I can mess around with the files without risking breaking my site.

    remove_action was a very useful pointer, thanks again for your help!

  4. konradS
    Member
    Posted 11 months ago #

    awesome, great to hear this! :D

Reply

You must log in to post.

About this Theme

About this Topic