get_footer not showing for Wordpress site - php

For some reason my footer disappeared for my site http://juliannaspizza.com.
I checked the template file for the home page and get_footer is being called as shown below. Any idea why my footer is still not showing up?
<?php
/**
* Template Name: Full Width Page
*
* #package Fortune
*/
get_header();
get_template_part( 'parts/single', 'page-header' ); ?>
<div class="container full-width-page">
<div class="row">
<div id="primary" class="content-area col-lg-12">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'content', 'page' );
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile; ?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .row -->
</div><!-- .container -->
<?php
get_footer();
This is what my footer used to look like (https://certifagift.blog/):

Your widgets are gone. From the markup, it looks like your footer (which does appear) is expecting to have widgets, but those are not appearing. Go to Appearance -> Widgets in your dashboard and add your widgets back in, and you should be good.

Related

Blog Main Header Showing Recent Post Title Instead

My Wordpress blog works fine on the main page that shows all posts, however, when I click a category the most recent post's title becomes the main header and that post doesn't even show up in the blog post list of that category.
https://ibb.co/ebReRV
I spied on other people with the same theme as me and they have the same problem so I believe this is a problem with the original code. My theme's creator seems to have disappeared and hasn't responded to any of my messages.
archive.php
<section id="wp-main-content" class="clearfix main-page title-layout-standard">
<?php do_action( 'naturalfood_before_page_content' ); ?>
<div class="container">
<div class="main-page-content row">
<!-- Main content -->
<div class="content-page <?php echo esc_attr($main_content_config['class']); ?>">
<div id="wp-content" class="wp-content">
<?php get_template_part('templates/layout/archive') ?>
</div>
</div>
You Need to Create Archive Page
Give Archive Page name is "archive.php".
Archive Page Structure Like this:
<?php
/*
Template Name: Archives
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
/* Custom Archives Functions Go Below this line */
/* Custom Archives Functions Go Above this line */
</div><!-- .entry-content -->
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Home Page Full Width No Side Bar

I am experimenting with a new design for my front page - http://www.rosstheexplorer.com/front-page-test/
I have set it so Google does not Index this page.
I set the template to Full Width, No Sidebar, this resulted in the plugins being hid but the text and pictures still do not cover the whole page. How can I address this?
This is my code for fullwidth-page.php
<?php
/**
* Template Name: Full Width, No Sidebar
*
* #package Penscratch
*/
// Access global variable directly to set content_width
if ( is_active_sidebar( 'sidebar-1' ) && isset( $GLOBALS['content_width'] ) )
$GLOBALS['content_width'] = 1091;
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php // If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) : comments_template();
endif; ?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>
To make it easier for you, you can change this line :
<div id="primary" class="content-area">
to this line :
<div id="primary" class="content-area" style="width: 100%;">

Apply css to custom Wordpress template

I am trying to establish 2 x custom page templates for a site using Zerif Pro on Wordpress 4.7.3
I have created the template files but can't get the layout I want.
I am trying to get a full-width template where the content appears directly below the navbar.
Using inspect element I can edit the CSS to
.content-left-wrap {
padding-top: 0px;
}
And get the desired look, but I can't figure out what to change in my fullwidth.php file or where to put it.
Template Code Below:
<div class="clear"></div>
</header> <!-- / END HOME SECTION -->
<?php zerif_after_header_trigger(); ?>
<div id="content" class="site-content">
<div class="container">
<div class="content-left-wrap col-md-12">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'content', 'page-no-title' );
/* If comments are open or we have at least one comment,
load up the comment template */
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
endwhile;
?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .content-left-wrap -->
</div><!-- .container -->
<?php
get_footer();
?>
Edit fullwidth.php Add another class to this div like this
<div class="content-left-wrap wrap-new col-md-12">
and then add css to the template css file using the new class
.wrap-new
{
.content-left-wrap {
padding-top: 0px;
}
}

Content inside page template is misplaced

I have a template in my Genesis theme child that is assigned to my homepage with a div that has an ID that I've styled in a separate CSS file.
That div contains a text, in the CSS sheet there's a background image to it.
I have a styled header through hooking it up through functions.
I have a footer aswell.
The problem is - the div that I mentioned is rendered below all these elements, as if it's not a part of the genesis structure.
There's header, footer, and below that the image with the text.
If I edit the page through the dashboard a new post is created that is positioned correctly.
How do I display the picture between the header and footer like it should be?
The code for the homepage template is:
<?php
/*
Template Name: Homepage Template
*/
genesis();
echo "<link rel='style' type='text/css' href='styles.css' />";
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
// Start the loop.
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
</header><!-- .entry-header -->
<div class="entry-content">
<div id="home_slider">
Electrical & Mechanical Engineering<br>In Nigera
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
<?php endwhile; // End the loop. ?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_footer(); ?>
The thing about Genesis content is that you have to use the Genesis hooks to add content to your page. There is a great visual guide for this here: http://genesistutorials.com/visual-hook-guide/
In your case, if you wanted to place your div just before the content area, you could do the following:
/**
* Template Name: Homepage Template
*/
add_action('genesis_before_content', 'add_extra_content_div');
function add_extra_content_div(){
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
// Start the loop.
while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
</header><!-- .entry-header -->
<div class="entry-content">
<div id="home_slider">
Electrical & Mechanical Engineering<br>In Nigera
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
<?php endwhile; // End the loop. ?>
</main><!-- .site-main -->
</div><!-- .content-area -->
?>
}
genesis();
One other point is that in Genesis you do not need to put in get_header() and get_footer() so you should remove these from your template.
Also, make sure that genesis(); is the very last line in the template - this is very important.

Wordpress Blank Page with header/sidebar/footer of my template

How can i create a page in a directory like public_html/test1 that has a single blank page with the header/sidebar/footer of my actual template.
I can only see the header, no sidebar , no content ( by content i mean "Hello." ).
I'm using twenty fourteen template.
This is the php code i am using:
<?php
/*
* Template Name: My own page!
* Description: I made a page!
*/
require (dirname(dirname( __FILE__ )).'/wp-load.php');
get_header();
get_sidebar();
?>
Hello.
Note: if i delete the the_content(); get_footer(); , then the header ONLY appears but without format.
Any help deeply appreciated
The content isn't appearing because there's no loop inside your template. Please add this code inside your template and move your template file to the 'page-templates' folder inside the twentyfourteen theme.
<?php
/*
* Template Name: My own page!
* Description: I made a page!
*/
get_header(); ?>
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( 'content', 'page' );
endwhile;
?>
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- #main-content -->
<?php
get_sidebar();
get_footer();
p.s. you can remove the div's if you'd like to.

Categories