Wordpress Header Background Image Issue - php

After hours of trying different things and codes, I came here to seek some help (I'm beginner in coding).
I'd like to put a full width and full height background image only in the header. The site is here: http://www.coveragenewstv.com/
Here is header.php :
<head>
<title><?php wp_title('|', true, 'right'); ?></title>
<meta charset="<?php bloginfo( 'charset' );?>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
wp_head(); /** we hook up in wp_booster #see td_wp_booster_functions::hook_wp_head */
?>
</head>
<body <?php body_class() ?> itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WebPage">
<?php //this is closing in the footer.php file ?>
<?php /* scroll to top */?>
<div class="td-scroll-up"><i class="td-icon-menu-up"></i></div>
<div id="td-outer-wrap">
<div class="td-transition-content-and-menu td-mobile-nav-wrap">
<?php locate_template('parts/menu-mobile.php', true);?>
</div>
<?php //this is closing in the footer.php file ?>
<div class="td-transition-content-and-menu td-content-wrap">
<?php
td_api_header_style::_helper_show_header();
do_action('td_wp_booster_after_header'); //used by unique articles

Add two code-blocks to the bottom of your css file:
.td-banner-wrap-full, .td-header-menu-wrap-full {
background-color: transparent;
}
and
.td-header-wrap.td-header-style-1 {
background-image: url(http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg);
background-size: cover;
}
Replace the url to your background image url.
See: Works fine

Related

Na latin-extendend in custom theme for Wordpress

I have created custom theme for wordpress - nothing complicated, just starting page, no footer, sidebar, menu. But here I have problem which I can't solve. I want to use font "Lato" from google fonts with latin extendend fonts (polish signs). As I provided proper codes in header (I think), in css, but still the result is like that: http://artystycznaperspektywa.com/
Here is header.php
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato&subset=latin-ext" rel="stylesheet">
</head>
Here is index.php:
<?php get_header(); ?>
<body>
<div class="container">
<div id='logo'><img src="<?php bloginfo( 'template_url' ); ?>/img/logo.png" ></div>
<div id="intro">Dziękujemy za odwiedzenie strony Artystycznej Perspektywy. Zapraszamy do zapoznania się z naszą ofertą:</div>
<div id="select">
<div id="malarstwo">
<div class="sign1">
<div class="name1">
<img src="<?php bloginfo( 'template_url' ); ?>/img/malarstwo.jpg" >
<a class="link" href="http://artystycznaperspektywa.com/malarstwo/">Malarstwo ścienne</a>
</div>
</div>
</div>
<div id="fotografia">
<div class="sign2">
<div class="name2">
<img src="<?php bloginfo( 'template_url' ); ?>/img/fotografia.jpg" >
<a class="link" href="http://artystycznaperspektywa.com/fotografia/">Fotografia</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
And of course in css font is put in html, body.
Does someone see what can couse problems with fonts? This problem does not appear in other sites (which are made on ready theme), only on this custom theme.
Please check if selected encoding of the file index.php in your code editor is UTF-8, probably it's not, and because the charset of the page is set to UTF-8 <meta charset="UTF-8" /> this causes the problems to appear.

Wordpress html5blank theme - Media Queries not working

I am using the html5blank to create a site on WordPress. Locally, the media queries are working perfectly fine but when and I add them to the wordpress style.css file, they don't seem to work. I have got rid of all media queries and kept only a simple one just to test it and it's still not working. I have my media queries at the end.
This is part of my header.php file:
<!doctype html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="css/font-awesome.min.css" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Raleway:400,500,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">
<meta charset="<?php bloginfo('charset'); ?>">
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<link href="//www.google-analytics.com" rel="dns-prefetch">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory')?>/style.css" />
<link href="<?php echo get_template_directory_uri(); ?>/img/icons/favicon.ico" rel="shortcut icon">
<link href="<?php echo get_template_directory_uri(); ?>/img/icons/touch.png" rel="apple-touch-icon-precomposed">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php bloginfo('description'); ?>">
<?php wp_head(); ?>
<script>
// conditionizr.com
// configure environment tests
conditionizr.config({
assets: '<?php echo get_template_directory_uri(); ?>',
tests: {}
});
</script>
</head>
<body <?php body_class(); ?>>
<header>
These are the simple media queries I added for testing in Wordpress to the bottom of the css file, but are not working:
#media screen and (min-width: 600px) {
div.balancepersonal {
font-size: 100px;
}
}
#media screen and (max-width: 600px) {
div.balancepersonal {
font-size: 10px;
}
}
This is the p tag in the index.php file I'm trying to make responsive:
<div class="balance-personal">
<div class="balance-container">
<div class="top-div-balance">
<img src="img/IMG_6739.jpg" class="trees-photo">
<div class="trees-shadow">
<div class="container amenidades-txt">
<p class="balancepersonal">BALANCE PERSONAL</p>
You want the stylesheet_url param for bloginfo as seen here: https://developer.wordpress.org/reference/functions/get_bloginfo/
Reason: your current param gives location on the server file directory as opposed to a web location a browser can access.
Edit stylesheet_url should give you the complete location to your style.css.
Alternatively you could use the template_directory_uri (as you are elsewhere) and add the style.css part

Adding wp_head() in wordpress header makes everything in body disappear

I am starting with wordpress and after adding dynamic heading <?php wp_head(); ?> everything in the body disappears.
this is my header.php file
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset');?>">
<title><?php bloginfo('name');?> | <?php wp_title();?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<?php bloginfo('template_url'); ?>/css/bootstrap.css" rel="stylesheet">
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet">
<?php wp_head(); ?>
</head>
When I remove the <?php wp_head(); ?> line, everything in the body shows. I am told that including the line is a must in wordpress.
On your header.php you have to call:
<?php wp_head(); ?>
On your internal pages, like index.php you have to call:
<?php get_header(); ?>
See:https://codex.wordpress.org/Theme_Development
Also you can turn your debug mode on in order to identify the errors.
https://codex.wordpress.org/Debugging_in_WordPress

Rogue &nbsp in Wordpress blog

I have a weird problem with my Wordpress blog.
&nbsp is inserted right after the <body> tag. There's no &nbsp in the header.php file, though. It's just the <body> tag and then a <div>.
Is there any way to stop this?
Thanks in advance!
EDIT |
This is the header.php:
<!DOCTYPE html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="<?php echo esc_url( 'gmpg.org/xfn/11' ); ?>">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="wrapper">
<?php do_action('__before_header') ; ?>
<?php hu_get_template_part('parts/header-main'); ?>
<?php do_action('__after_header') ; ?>
<div class="container" id="page">
<div class="container-inner">
<?php do_action('__before_main') ; ?>
<div class="main">
<div class="main-inner group">
<?php do_action('__before_content') ; ?>
What is ?
It's good explained here
How to remove from html?
You should find beetwen which html tags it's occured and delete all spaces which are between that tags.
Considering discussion on your question: after body tag you got . So, just removing spaces after <body> from header.php of your wordpress child and parent themes stops rendering .

Remove unnecessary header in wordpress

I was just working with wordpress and managed to get my site up. Now i am getting this unnecessary header in my site (the black header ... right at the top), see below:
.
My header code looks like below:
<!doctype html>
<html <?php language_attributes(); ?> >
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title><?php bloginfo('name'); ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="style.css">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<h1><?php bloginfo('name'); ?></h1>
<h5><?php bloginfo('description'); ?></h5>
<nav class="site-nav">
<?php
$args = array(
'theme_location' => 'primary'
);
?>
<?php wp_nav_menu($args); ?>
</nav>
</header>
I am new to workpress and just beginning to learn stuff.
How can i remove this header?
Thank you.
Wordpress shows this admin bar by default when you are logged in in the backend. Non-admin users will not see it, but you can disable this in your profile if you want.
Go to Users -> Your profile
Disable the option Show toolbar when viewing site
remove this line, the header will goes hide
<?php wp_head(); ?>

Categories