So far my footer has always done it. But suddenly it disappeared when I started my site. This is a seperated footer in a wordpress site. Loading is going well, because when I use a different code for my footer, it works. I suspect something is not right in my footer.php, but I don't know what?
I have tried some other pieces of code from other footer.php 's. This worked but could not find the difference between my code and theirs.
This is my footer.php (My active theme is a yoga child theme):
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after.
*
* #package yoga
*/
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--==================== FOOTER====================-->
<?php
$yoga_footer_widget_background = get_theme_mod('yoga_footer_widget_background');
if($yoga_footer_widget_background != '') { ?>
<footer style="background-image:url('<?php echo esc_url($yoga_footer_widget_background);?>');">
<?php } else { ?>
<footer>
<?php } ?>
<div class="overlay">
<!--Start yoga-footer-widget-area-->
<?php if ( is_active_sidebar( 'yoga-footer_widget_area' ) ) { ?>
<div class="yoga-footer-widget-area">
<div class="container">
<div class="row">
<?php dynamic_sidebar( 'yoga-footer_widget_area' ); ?>
<!-- Contact symbols -->
<div id="text-4" class="col-md-4 col-sm-6 yoga-widget widget_text">
<div class="textwidget">
<a href="# 1"><i class="fab fa-facebook-square fa-3x"></i><a>
<a href="#2"><i class="fab fa-linkedin fa-3x"></i><a>
<a href="#3"><i class="fab fa-instagram fa-3x"></i><a>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<!--End yoga-footer-widget-area-->
</div>
</footer>
<!--Scroll To Top-->
<i class="fa fa-caret-up"></i>
<!--/Scroll To Top-->
<?php wp_footer(); ?>
</body>
</html>
I hope someone can see the error in my code, and has a solution for it.
Related
I'm currently working on a Wordpress site, using the Rhythm theme - it's default template has four columns built into the footer, and I'd like to only have three.
So in my child theme, I went into the widget section and removed a column from the php code, so it looks like this:
if (ts_get_opt('footer-widgets-enable') == 1): ?>
<!-- Divider -->
<hr class="mt-0 mb-0"/>
<!-- End Divider -->
<!-- Widgets Section -->
<section class="footer-sidebar page-section">
<div class="container relative">
<div class="row multi-columns-row">
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-1', 'footer-sidebar-1') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-1', 'footer-sidebar-1') ); ?>
<?php endif; ?>
</div>
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-2', 'footer-sidebar-2') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-2', 'footer-sidebar-2') ); ?>
<?php endif; ?>
</div>
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-3', 'footer-sidebar-3') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-3', 'footer-sidebar-3') ); ?>
<?php endif; ?>
</div>
</div>
</div>
</section>
<!-- End Widgets Section -->
The problem I'm having is that the page is still referencing the code with four columns instead. So I'm guessing my issue is in my footer.php file, or the template-parts.php file and that it's not pointing to the proper file.
My biggest concern is that I didn't set up my child theme correctly, and now the coding is trying to reference two different themes.
I have something that I just can't understand. I did a one page layout site in wordpress. It consist of one template-index.php that only have one mainContainer div and about 6 include_once template-. Then in the admin section of wordpress I used advanced custom fields to create the different fields all related to template-index.php.
Everything shows up just fine except for the text on the last frame or last include if you will. But here is the strange thing. If I change the order of the last two includes both text shows up just fine and then when I change the order back the last include loose it's text again.
I checked the code, every php tag is closed just fine, the include before also. I don't know. Did something like this ever happen to one of you? What could it be?
Thanks
edit:
here is a bit of code.
So the index page is pretty simple:
<?php
/* Template Name: index template */
?>
<?php get_header(); ?>
<div class="mainContainer"id='fullpage'>
<?php include_once 'template-about.php'; ?>
<?php include_once 'template-theDesign.php'; ?>
<?php include_once 'template-theApp.php'; ?>
<?php include_once 'template-getApp.php'; ?>
<?php include_once 'template-community.php'; ?>
<?php include_once 'template-contact.php'; ?>
</div>
<?php get_footer(); ?>enter code here
the last two includes look like this:
<?php
/* Template Name: Bob community template */
?>
<!-- <div id="section-5"> -->
<div class="sectionContainer community section" id='section_five'>
<div class="container main">
<div class="vertical100 firstSection col-md-12 topSection ">
<section class='worldMap animation col-md-6'>
<div class="imgContainer">
<div class="wordpressImg">
<img class='worldMap' src="<?php echo get_template_directory_uri(); ?>/img/worldmap.png" />
</div> <!-- wordpressImg -->
</div><!-- imgContainer -->
</section>
<section class="explications col-md-6">
<div class="communityExplication">
<div class="wordpressTexte">
<?php the_field('community_text'); ?>
<div class="stories">
<?php
$args = array( 'post_type' => 'stories', 'posts_per_page' => 8, 'orderby' => 'rand' );
$loop = new WP_Query($args);
$posts = $loop->posts;
if(have_posts()) {
$first = true; ?>
<div class="storieAligner">
<div class="stories-container ">
<?php
$count = 0;
while($loop->have_posts() ) : $loop->the_post();
$randomPost = $posts[$count];
$image = get_field('images');
$temoignage = get_field('temoignage');
?>
<!-- <div class="storiePhoto"> -->
<div class='storiesThumbs' style='background-image: url("<?php echo $image['url']; ?>")' data-temoignage="<?php echo $temoignage; ?>"></div>
<div class="categorie"></div>
<!-- </div> -->
<?php $count++; endwhile; ?>
</div> <!-- stories-container -->
<div class="fullStorie hiddenStorie">
<div class="back"></div>
<div class="leftDiv">
<div class="leftContent">
</div>
</div>
<div class="rightDiv">
<div class="rightContent"></div>
</div>
</div>
</div> <!-- storieAligner -->
<?php }; ?> <!-- if have_posts -->
</div> <!-- stories -->
<div class="linkContainer" ><a class='formToggle pinkButton roll' href="#" title="Wha you say"><span data-title='What you say'>What you say</span></a></div>
</div> <!-- wordpressTexte -->
</div> <!-- commnunityExplication -->
<!-- <div class="storiesFormContainer"> -->
<div class="storiesForm hidden">
<div class="formContainer">
<h1><?php echo __('Leave a Review of your app ', 'site'); ?></h1>
<?php echo do_shortcode('[contact-form-7 id="89" title="community-contact"]'); ?>
</div>
</div>
<!-- </div> storiesFormContainer -->
</section>
</div> <!-- get app -->
</div> <!-- main -->
and the contact template like this
<?php
/* Template Name: Contact-us template */
?>
<!-- section-6 -->
<div class="sectionContainer contact section" id='section_six'>
<div class="container main" >
<div class="vertical100 col-md-12 topSection ">
<section class='explications col-md-3'>
<div class="blockTexte">
<div class="wordpressTexte">
<?php the_field('questions'); ?>
<a class ='pinkButton roll' href="#" title="visit page"><span data-title='<?php echo __('visit page', 'site'); ?>'><?php echo __('visit page', 'site'); ?></span></a>
</div>
</div>
</section>
<section class="formulaire col-md-9">
<div class="formContainer">
<div class="wordpressForm">
<?php echo do_shortcode('[contact-form-7 id="44" title="contact-us"]'); ?>
</div>
</div>
</section>
</div> <!-- knowBob -->
</div>
So what could be wrong?
P.s. I know there's a bit a french and english in the code. I usually write what comes up first in my head.
You need to reset the post data to the original query using wp_reset_postdata after you're done looping through a custom query:
<div class="stories-container ">
<?php
$count = 0;
while($loop->have_posts() ) : $loop->the_post();
$randomPost = $posts[$count];
$image = get_field('images');
$temoignage = get_field('temoignage');
?>
<!-- <div class="storiePhoto"> -->
<div class='storiesThumbs' style='background-image: url("<?php echo $image['url']; ?>")' data-temoignage="<?php echo $temoignage; ?>"></div>
<div class="categorie"></div>
<!-- </div> -->
<?php $count++; endwhile; wp_reset_postdata(); ?><!-- this line here -->
</div> <!-- stories-container -->
Otherwise the $post object will remain the last post of the $loop query, causing any other behind the scenes requests for post data down the road (in your case get_field) to reference the wrong post until you hit the outer loop again.
I have adjusted my mainnav.php file in the T3 template for joomla so my navigation is fixed to the top of the page. However, I cannot figure out how to add my logo to the left of my fixed navigation?
<!-- MAIN NAVIGATION -->
<nav id="t3-mainnav" class="wrap navbar navbar-default t3-mainnav navbar-fixed-top navbar-collapse-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<?php if ($this->getParam('navigation_collapse_enable', 1) && $this->getParam('responsive', 1)) : ?>
<?php $this->addScript(T3_URL.'/js/nav-collapse.js'); ?>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".t3-navbar-collapse">
<i class="fa fa-bars"></i>
</button>
<?php endif ?>
<?php if ($this->getParam('addon_offcanvas_enable')) : ?>
<?php $this->loadBlock ('off-canvas') ?>
<?php endif ?>
</div>
<?php if ($this->getParam('navigation_collapse_enable')) : ?>
<div class="t3-navbar-collapse navbar-collapse collapse"></div>
<?php endif ?>
<div class="t3-navbar navbar-collapse collapse">
<jdoc:include type="<?php echo $this->getParam('navigation_type', 'megamenu') ?>" name="<?php echo $this->getParam('mm_type', 'mainmenu') ?>" />
</div>
</div>
</nav>
<!-- //MAIN NAVIGATION -->
You have to add logo div before <div class="container"> and float both divs left like:
#t3-mainnav .logo_container,
#t3-mainnav .container {
float: left;
}
Hope this helps
on my new theme in wordpress a <em> Tag is outputed, but i don't know why...
I dont use any <em> Tags anywhere in my theme, so i can't understand why this is outputed and destroys my design.
Here the Content of my index.php
<?php get_header(); ?>
<div class="row">
<div class="col-sm-12 blog-content">
<div class="container">
<div class="col-sm-8 blog-main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-sm-12 blog-post">
<div class="date">
<div class="corner"></div>
<?php the_date('d M Y'); ?>
</div>
<h2><?php the_title(); ?></h2>
<div class="meta">
<i class="icon-user"></i>
<span><?php the_author(); ?></span>
<i class="icon-bookmark"></i>
<span><?php the_category(', '); ?></span>
<i class="icon-bubble"></i>
<?php comments_number('0 Kommentare', '1 Kommentare', '(% Kommentare)' );?>
</div>
<div class="entry">
<?php echo apply_filters('the_content', substr(get_the_content(), 0, 400) ); ?>
</div>
<div class="row">
<div class="col-sm-offset-8 col-sm-4 col-md-offset-9 col-md-3 col-lg-offset-9 col-lg-3 more">
<div class="btn">
Mehr lesen
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
<?php get_sidebar(); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
Here you can watch my problem live. thorstenreichelt.de
Thanks for Help ;)
There is a em tag in your content (not in your theme). As you truncate it for the preview, in the first 400 characters you have the opening em tag but not the closing one, so the final HTML and your design are "broken".
Have a look at strip_tags() PHP function, or any equivalent used in Wordpress theming functions.
Try add this:
remove_filter ('the_content', 'wpautop');
remove_filter ('comment_text', 'wpautop');
at the final of the functions.php file from your theme.
Could it be that you're pasting in some content to that post from somewhere, and its some formatting thats coming across with it.
Have you gone into edit that post and click "text" in the top right corner of the main editing area, next to where it says visual. Is there a stray tag there?
I can't seem to decode this base64 string which is in the footer of a wordpress theme. I want to be able to add more to the footer.
Any help appreciated, thanks!
<?php eval(stripslashes(gzinflate(base64_decode("pVNRa9swEH7OYP/h1kG7PbiGwfaQuM7D1tCwsY42UAaBINsXWyD7hKTO87/vSXUct3PZYPKLdN/5vrvvk5Yp8JrNkkL+glwJay+2J7lCYdBsT9Ik5nj6+lVIGh+e7N9EEWBTQGuE1mgginpkhFsnjIMVkRsnBFpZMOc+IEx5IHuGfBigwxplqD/AkHCvJqIBUXIYtqIa/aQCKoN7DiRLXWnAvCIo0e1IO0nNu+1ZSDx7v4BlGvMPV3xMYsESKZnCCzyhVKt3Slq306JEy4WcdAo5dNFXm+g8nmz9H0w6VpiIHQV7FDoYs7q+3lzewOebyy/rzS18W3//6v2ZMZzJMk2sM9SU6WlOulvASJxCOORpfvZT9FCmqJTNnhhpxCBYEvdlkjgUzYynt7VQamA4OlA5p+dx3Lbt+d4gugprVKKje2fPc6pZfb5OnUKvAikyc3j76aP/Fg5/u6jAnIzwrs2hoQYXnB805/wV14M7MsUPg9bCxpe2LMbzkHcWsg7W9RVZhwVMdifrKqC+q/9o6g4zKx2Cp5JN6dt5Ggn3bFDwUbbB25eN//uLHb/HQwJbREUXNpWrPRFvlw8=")))); ?>
Replace eval with print and see what it says.
The full result is:
?> <div class="clearer"></div>
</div>
</div>
<!-- end wrapper -->
<!-- start Footer -->
<div id="footer">
<div id="footer2">
<div id="fl">
<ul>
<li class="home">Home</li>
<?php wp_list_pages('title_li='); ?>
</ul>
<div class="clearer"></div>
</div>
<div id="fr">
<!-- FOOTER CREDITS LINK -->
<big><strong>© <?php echo date('Y'); ?> <?php bloginfo('name'); ?></strong></big><br>
<small><strong>WordPress Themes by ImHosted Website Hosting<strong></small>
</div>
</div>
</div>
<!-- end Footer -->
</div>
</body>
</html>
<?