wordpress, how do you change the information in the footer? - php

I am building a website in wordpress, with the twentythirteen theme. And I want to get rid of the words "this is a blog... (the search bar)... recent posts... recent comments and so forth." But the only page that has any coding for the footer is the footer.php. Here is the coding for the footer.php. Is there anything I am like missing here? Because I am not seeing anything that I can change without the whole footer being removed in general. I am really stuck, can someone out there who can give me some clarity?
<?php
/**
* The template for displaying the footer.
*
* Contains footer content and the closing of the
* #main and #page div elements.
*
* #package WordPress
* #subpackage Twenty_Thirteen
* #since Twenty Thirteen 1.0
*/
?>
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
<?php get_sidebar( 'main' ); ?>
<div class="site-info">
<?php do_action( 'twentythirteen_credits' ); ?>
<?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>

there are two parts/components in your footer.
A module displayed
credits to WordPress.
if you want to remove side bar remove the code
<?php get_sidebar( 'main' ); ?>
if you want to remove the credits then remove the following code:
<?php do_action( 'twentythirteen_credits' ); ?>
<?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?>
else, remove both of them and you will get a clear footer.

I think what you're trying to get rid of are the default widgets. If that's the case, go to Appearance > Widgets, and drag and drop everything you want to remove off of the 'Main Widget Area' drop-down.

"this is a blog... (the search bar)... recent posts... recent comments This is comes from widget. If you don't want this you need to remove those widget.

Related

WordPress Twenty Seventeen static home page doesn't execute my custom template

I've built a custom page template in my twentyseventeen child theme that I know is working fine when I go directly to that page but when I set home page of my site to be a static and pointing to that page nothing displays. It will display any of text I have in the body but it does not seem to run any of the code in the template.
The static home page is here: https://wanderreader.com/
The page running on its own is here: https://wanderreader.com/book-list/#
I based my template on the TwentySeventeen page.php and, like I said, I know the code is working fine when I run the page on its own (i.e. not as a static home page) so I'm really scratching my head as to why it doesn't run any of my code when I set it to the home page.
<?php
/**
* Template Name: TravelBooksHome
*
* Derived from the 'page' template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* #link https://codex.wordpress.org/Template_Hierarchy
*
* #package WordPress
* #subpackage Twenty_Seventeen
* #since 1.0
* #version 1.0
*/
get_header();
//Set the Nonce to avoid any shenanigans with the ajax calls
$ajax_nonce = wp_create_nonce( "<removed for posting>" );
?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div id="MessageArea">
</div>
<div id="SelectedCategory">
Home
<br>
</div>
<hr>
<div id="FilterCategories">
<?php
$categories = get_categories( array(
'orderby' => 'name',
'show_count' => true,
'echo' => false,
'title_li' => '',
'depth' => '1',
'use_desc_for_title' => false,
'parent' => 0
) );
foreach ( $categories as $category ) {
printf( '%2$s<br />',
"categorySubmit('".$ajax_nonce."', ". $category->term_id .")",
esc_html( $category->name )
);
}
?>
</div>
<hr>
<div id="BookList">
</div>
<div id="BookCovers">
</div>
</main>
<!-- #main -->
</div>
<!-- #primary -->
</div>
<!-- .wrap -->
<?php get_footer();
You may want to take a look at this document: https://codex.wordpress.org/Creating_a_Static_Front_Page
On the site front page, WordPress will always use the front-page.php
template file, if it exists. If front-page.php does not exist,
WordPress will determine which template file to use, depending on the
user configuration of 'Settings > Reading ->Front page displays', as
follows:
A static page: WordPress uses the Static Page template hierarchy:
Custom Page Template, page-{id}.php, page-{slug}.php, page.php,
index.php
Your latest posts: WordPress uses the Blog Posts Index
template hierarchy: home.php, index.php
I think in your case you just need to edit or create front-page.php instead of page.php.

Template page not showing data in WordPress

I created a template page on WordPress Admin and just added a h2 heading which does not appear with associated link for the page but it's working if admin logged in wordpress login. I also made the page public on page setting but still the problem is not remove page data shown only to admin. I have searched many forums but didn't find any solution.
<?php
/*
Template Name: Contact Us
*/
get_header(); ?>
<div class="contact-box1">
<h2 >
<br><br>
YOUR ENQUIRY
</h2>
<?php get_footer(); ?>
its working fine in here its not problem with the templating i guess you have not selected the template name right side of the dashboard and only put one contact us to the page as http://amplifiedantennas.com.au/contact-us doesnt have anything assigned over there
how to create template in WordPress?
<?php
/**
Template Name: Contact Us
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* #link https://codex.wordpress.org/Template_Hierarchy
*
* #package WordPress
* #subpackage Amplified_Antennas
* #since 1.0
* #version 1.0
*/
get_header();
?>
<?php
while ( have_posts() ) : the_post();
?>
<div class="contact-box1">
<h2>Contact ENQUIRY</h2>
</div>
<?php
endwhile; // End of the loop.
?>
<?php
get_footer(); ?>
EDITED (I included the full code now):
It's not enough to include the header and the footer, you also need to include the loop in order to fetch the content which was for that particular page in the text editor (in the backend), where you should add/create your content.
So after creating that template, you need to create a "new page" in the backend, selecting that page template in the right sidebar.
In my example below, you would write your header into the title field in the backend, then it would be displayed as an h2 in the real page. And the whole content (inluding that title h2) is wrapped in the .contact-box1 DIV, as you had it in your original code.
example:
<?php
/*
* Template Name: Contact Us
* #package WordPress
* #subpackage Amplified_Antennas
*/
get_header(); ?>
<div class="contact-box1">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
} // end while
} // end if
?>
</div>
<?php get_footer(); ?>
P.S.: In your posted code, you are not closing this DIV tag: <div class="contact-box1">

How can I make a header taller in WordPress?

I want to make the header of this WordPress page taller. I found advice here that I should use the following code in the homepage template CSS file:
.full-container {
min-height: 390px;
}
The CSS file looks like this:
<?php
/**
* The template for displaying the home page panel. Requires SiteOrigin page builder plugin.
*
* Template Name: Page Builder Home
*
* #package vantage
* #since vantage 1.0
* #see http://siteorigin.com/page-builder/
* #license GPL 2.0
*/
get_header();
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<div class="entry-content">
<?php
if ( is_page() ) {
the_post();
the_content();
}
else if( function_exists('siteorigin_panels_render') ) echo siteorigin_panels_render('home');
else echo siteorigin_panels_lite_home_render();
?>
</div>
</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->
Where must I put the suggested code in?
In a Child Theme or wp-content/themes/vantage/style.css
The code you showed there as the CSS style is not the style at all, thats a costum page template named "Page Builder Home".
You should open style.css which is found directly on the theme folder. At the very end of style.css add the lines of css:
.full-container {
min-height: 390px;
}
If you dont know how to difference css files from php/html files then you definitely are in the wrong business and you should let the work be done by the pro-s.
having said that, hope my "solution" works for you.

How to make a right sidebar for a wordpress theme

How I can make a right sidebar for a wordpress theme and integrate with advanced search like the concept below:
sidebar.php
<?php
/**
* The sidebar containing the main widget area.
*
* #link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* #package custom
*/
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
return;
}
?>
<div id="secondary" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- #secondary -->
<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<div id="tertiary" class="widget-area" role="supplementary">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div><!-- #secondary .widget-area -->
<?php endif; ?>
style.css for sidebar
#secondary { /* left Sidebar */
width: 18rem;
margin-left: -67rem;
float: left;
position: relative;
}
#tertiary { /* right Sidebar */
width: 18rem;
margin-right: -23rem;
float: right;
position: relative;
}
How I can achieve it in an easy way?
Have a look at the WordPress Codex for information about customizing the sidebar. This page has a lot of information on it about the sidebar: https://codex.wordpress.org/Customizing_Your_Sidebar
If you are asking how to get a menu to expand from the side of the screen, there are many different CSS/JavaScript implementations, but perhaps something like this jQuery Slick Plugin might help: http://www.designchemical.com/lab/jquery-slick-plugin/examples/
If you are asking how to create the custom search functionality, then that is going to be very dependant on the plugins you are using and what you are searching for. This article does give a good overview of getting started with customised search capabilities and custom search forms in WordPress: https://premium.wpmudev.org/blog/build-your-own-custom-wordpress-search/
If you already have your sidebar.php set up in your template file where you want it; it could be index.php,single.php,page.php or whatever
I see two ways of doing it
1 - Install some fancy search plugin and add it your sidebar using Dashboard - Appearance - Widgets area
2 - In your Widget area you can add Html content where you will have your search form OR hardcode it in your sidebar.php OR create search-form.php(where you will have your form) and include it in your sibedar.php or directly to the template file using get_template_part()
here are some useful links:
https://codex.wordpress.org/Function_Reference/get_search_form
https://codex.wordpress.org/Function_Reference/get_template_part

How to show only the date, the title and a litle "summary" of my WordPress post in my custom theme?

I am pretty new in WordPress theme development and I have the following doubt about how show posts into a page.
I have this page belonging to an old custom legacy blog that I am build again using WordPress: http://www.asper-eritrea.com/comunicati.asp
As you can see in this page are presented some posts using the following structure: date followed by the post title followed by a short summary
What I want to do in WordPress is something like it.
So I have create this page that show the posts lists: http://lnx.asper-eritrea.com/category/legacyposts/
As you can see in this page are shown the posts (the formattation is horrible because I imported the post from the old website but I will work on it in a second time).
The main problem is that if the post is very long it is shows all of its contents.
This is the code of this page (category.php) is:
<?php get_header(); ?>
<!-- Contenuti (griglia) -->
<div class="container">
<!-- Lead presentazione -->
<section id="presentazione">
<div class="row">
<div class="col-sm-12">
<!--<h1 class="text-center"><small>Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</small></h1>-->
<h1 class="text-center title">Associazione per la Tutela dei Diritti Umani del Popolo Eritreo</h1>
<h1 class="text-center leadTitle">Association in Defense of the Human Rights of the Eritrean People</h1>
<!--
<p class="lead text-center">
Association in Defense of the Human Rights of the Eritrean People
</p>
-->
</div><!-- /.col-sm-12 -->
</div><!-- /.row -->
</section><!-- /section presentazione -->
<!-- Progetti in evidenza -->
<header class="header-sezione">
<h2>Ultimi Articoli</h2>
</header>
<?
// get the term using the slug and the tag taxonomy
$term = get_term_by( 'slug', 'featured', 'post_tag' );
// pass the term_id to tag__not_in
query_posts( array( 'tag__not_in' => array ( $term->term_id )));
?>
<?php
if (have_posts()) :
// Start the Loop.
while (have_posts()) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part('content', get_post_format());
endwhile;
else :
// If no content, include the "No posts found" template.
get_template_part('content', 'none');
endif;
?>
</section>
</div>
<?php get_footer(); ?>
So what I want to do is that, for each post, the loop show only the date, the title and the beginning of my post (for example a specific number of character).
What can I do to obtain this result?
Tnx
first you should start reading the wordpress codex, that way you can know how wordpress works.
Now, the category.php template is trying to find other template part with this code:
get_template_part("content", get_post_format());
This code is looking for content-post format.php, in case that file doesn't exist, wordpress automatically looks for content.php and that file is the one you have to work.
You must find this file and you use the following functions
the_excerpt();
get_the_date();
the_title()
Now if you want to control the size of the excerpt, you can use this function inside of function.php.
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Categories