• cmeister

    (@cmeister)


    Hi All,

    I received some advice on the forum to create a child theme for the Duena theme.

    In order to modify the header text, I was instructed to copy the Header.php file to the child theme’s root directory and then edit the child theme’s header file.

    Another member (esmi) said that I had access to the core HTML, because my site was independently hosted. He said I’d find the file in Dashboard -> Appearance. The list of files along the right side includes only PHP files and two .CSS files.

    Where is the core HTML for the header section of the theme? (I realize that PHP files can contain HTML code).

    Original mail below……

    Hi All,

    PHP rookie here….

    For my Duena theme there is customization in the Dashboard for a title and site description on the home page.

    The title, in my case. is a person’s name. I want to target the last name only and stylize it in “Style.css”. If I was working with an HTML file, I would add a <span> tag and class.

    It looks like I need to modify the “Header.php” code in some way to target the name. The code does not distinguish between first and last name.

    Code below:

    <div class=”container clearfix”>
    <div class=”logo”>
    <?php if (( of_get_option(‘logo_type’) == ‘image_logo’) && ( of_get_option(‘logo_url’) != ”)) { ?>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><img src=”<?php echo esc_url( of_get_option(‘logo_url’) ); ?>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>”>
    <?php } else { ?>
    <?php if ( is_front_page() || is_home() || is_404() ) { ?>

    <h1 class=”text-logo”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h1>
    <?php } else { ?>
    <h2 class=”text-logo”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h2>
    <?php } ?>
    <?php } ?>
    <p class=”site-description”><?php bloginfo( ‘description’ ); ?></p>
    </div>
    <?php if ( of_get_option(‘g_search_box_id’) == ‘yes’) { ?>

    Hope you can help!

    Thanks,

    cmeister

    sdavis2702
    Member
    Posted 1 week ago #

    You are correct that adding a span and class around the last name would do the trick. And as you can see, the Site Title is not being output with raw content, but PHP instead. So here’s what you can do…

    Create a child theme if you haven’t already and copy the header.php file to the root of your child theme. As you’ve already noticed, the code outputting the Site Title is:

    <?php bloginfo( ‘name’ ); ?>

    You can remove that and simply hard code your site title in place. Take note that the above code appears twice because of the SEO considerations. So replace it in both places. Then with your pure HTML in place, you can span and class it up however you’d like!

    To make sure the title/logo functionality continues to work as the theme intended, be sure not to edit anything else unless you know exactly what you’re doing.

    Hope this helps!

    cmeister
    Member
    Posted 1 week ago #

    sdavis2702,

    Thanks.

    You mentioned pure HTML. Do I have access to HTML at all?

    This WP install is hosted (not by WP).

    Which HTML file would I be editing, and where is it located?

    Thanks,

    cm

    esmi
    Theme Diva & Forum Moderator
    Posted 1 week ago #

    Is this a wordpress.com site or a self-hosted WordPress install?

    cmeister
    Member
    Posted 1 week ago #

    It’s self-hosted.

    esmi
    Theme Diva & Forum Moderator
    Posted 1 week ago #

    In that case, you do have access to the HTML in the theme’s template files via Appearance -> Editor but do not edit any of them. Instead, create a child theme for your changes.

The topic ‘[Theme: Duena] – Child Theme – Header Modification’ is closed to new replies.