A
A
Alexey FRZ2015-02-01 09:55:59
CMS
Alexey FRZ, 2015-02-01 09:55:59

Editing the Wordpress template code. What and how to change?

The main page was created according to template No. 1. There is a large picture in the center of the default template. How to remove it on subsequent pages? There is only one template.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya Koshkarov, 2015-02-01
@leshqow

Paste the image output code only in the home.php file. If there is no such thing in your template, then through the conditions

<?php 
if( is_front_page() )
{
echo "Картинка";
} 
?>

S
SergZay, 2015-02-01
@SergZay

<?php
if( is_front_page() ){
echo "This is the front page";
} else {
echo "this is not the main page";
}
?>

D
Damir Rysaev, 2015-02-01
@freepad

Use home.php
To avoid such questions in the future, read the WordPress codex about template hierarchy.
In English: Template Hierarchy Two more useful links in English: Creating a Static Front Page , an interactive template hierarchy map

Home Page display
Template file used to render the Blog Posts Index, whether on the site front page or on a static page. Note: on the Site Front Page, the Front Page template takes precedence over the Blog Posts Index (Home) template.
  1. home.php
  2. index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question