简体   繁体   中英

how to add a logo to this wordpress code

I downloaded this free WP Simple theme and is modifying mostly everything in the backend. Otherwise, I'll have to pay more and I heard from some people who said that they paid for this theme and didn't get all the features and support they wanted.

Anyway, I'm trying to add the logo to this code

<?php
$nimbus_image_logo = trim(nimbus_get_option('nimbus_image_logo'));
$nimbus_text_logo = trim(nimbus_get_option('nimbus_text_logo'));
if (empty($nimbus_image_logo)) {
    if (!empty($nimbus_text_logo)) {
    ?>
        <h1 class="text_logo"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo $nimbus_text_logo; ?></a></h1>
    <?php
    }
} else {
?>
    <a class="" href="<?php echo esc_url(home_url('/')); ?>"><img class="image_logo" src="<?php echo $nimbus_image_logo; ?>" alt="<?php echo get_bloginfo('name', 'display'); ?>" /></a>
<?php
}
?>

The logo url is "<?php bloginfo('template_url');?>/images/Novalogo.png" .

I tried adding it to $nimbus_image_logo = at top, but it's not working. I also tried to add and replace it at <?php echo $nimbus_image_logo; ?> <?php echo $nimbus_image_logo; ?> but it's not working also.

How do I fix it?

如果您想要一个仅图像徽标的简单解决方案,请仅用此行替换所有内容。

<a class="" href="<?php echo esc_url(home_url('/')); ?>"><img class="image_logo" src="<?php bloginfo('template_url');?>/images/Novalogo.png" alt="<?php echo get_bloginfo('name', 'display'); ?>" /></a>

My best guess would be to remove the conditional statement entirely. Try removing all of that code and just leaving this:

<a class="" href="<?php echo esc_url(home_url('/')); ?>"><img class="image_logo" src="<?php bloginfo('template_url');?>/images/Novalogo.png" alt="<?php echo get_bloginfo('name', 'display'); ?>" /></a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM