Sprawdź:
Hejko!
Mam taki problem a za bardzo nie znam się na programowaniu
Chciałbym aby mój obrazek z nagłówka przekierowywał na stronę główną.
Potrafisz zrobić coś takiego?
Tutaj mój plik: header.php
Kod:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2044334889159553"
crossorigin="anonymous"></script>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="profile" href="http://gmpg.org/xfn/11">
<script src="https://kit.fontawesome.com/297312201a.js" crossorigin="anonymous"></script>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<!-- Preloader -->
<?php get_template_part( 'templates/header/preloader' ); ?>
<!-- Page Wrapper -->
<div id="page-wrap">
<!-- Boxed Wrapper -->
<div id="page-header" <?php echo esc_attr(bard_options( 'general_header_width' )) === 'boxed' ? 'class="boxed-wrapper"': ''; ?>>
<?php
// Top Bar
get_template_part( 'templates/header/top', 'bar' );
// Page Header
get_template_part( 'templates/header/page', 'header' );
// Main Navigation
get_template_part( 'templates/header/main', 'navigation' );
?>
</div><!-- .boxed-wrapper -->
<!-- Page Content -->
<div class="page-content">
<?php get_template_part( 'templates/sidebars/sidebar', 'alt' ); // Sidebar Alt ?>
A tutaj plik: page-header.php
Kod:
<?php if ( bard_options('header_image_label') === true ) : ?>
<div class="entry-header" data-parallax="<?php echo esc_attr(bard_options( 'header_image_parallax' )); ?>" data-image="<?php echo esc_attr(get_header_image()); ?>">
<div class="cv-outer">
<div class="cv-inner">
<div class="header-logo">
<?php
if ( has_custom_logo() ) :
$custom_logo_id = get_theme_mod( 'custom_logo' );
$custom_logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php esc_attr( bloginfo('name') ); ?>" class="logo-img">
<img src="<?php echo esc_url( $custom_logo[0] ); ?>" width="<?php echo esc_attr( $custom_logo[1] ); ?>" height="<?php echo esc_attr( $custom_logo[2] ); ?>" alt="<?php esc_attr( bloginfo('name') ); ?>">
</a>
<?php // SEO Hidden Title
if ( true === bard_options( 'title_tagline_seo_title' ) ) {
echo ( is_home() || is_front_page() || is_category() || is_search() ) ? '<h1 style="display: none;">'. get_bloginfo( 'title' ) .'</h1>' : '';
}
?>
<?php endif; ?>
<?php if ( '' !== get_bloginfo( 'description' ) ) : ?>
<p class="site-description"><?php echo bloginfo( 'description' ); ?></p>
<?php endif; ?>
</div>
<?php // Social Icons
if ( bard_options( 'title_tagline_show_socials' ) === true ) {
bard_social_media( 'header-socials', false );
}
?>
</div>
</div>
</div>
<?php endif; ?>
Wierzę w Ciebie!
Sam siedzę już godziny nad tym i nie umiem nic rozkminić :X