How to change the theme for Wordpress
?Wordpress has a huge number of great themes, but they usually prefer to adapt to their site.

Changing the topic encounters a number of difficulties and often leads to disfigurement of the site and its unsuitability, which ultimately leads to a simple return to the default topic.
We will look at how to solve most of these difficulties, taking as an example Koluriza, which is a good topic and has the advantage that it is very easy to change. This theme uses a black background and is not suitable for text content, but for images, but it is not very difficult to turn colors and convert the background to white, and the text to black!
Choose a topic
When choosing a theme, you cannot rely on colors, headings, images, as they are easily edited in the style sheet.
In fact, only the location of the sections and the fact that the width is fixed or variable (smooth) are considered. These parameters are very difficult to change .
In addition, you need to choose a topic whose code should be well designed and easily changeable, but this is known only if you can get instructions on this topic and not always have them without reading the source code.
If you like a theme, but the layout of the elements doesn't suit you, rather than trying to change them by rubbing in a stylesheet, the best solution would be to set a different theme that you need a layout and give it the style attributes of the theme that you like.
Change theme
To modify an element, delete it, move it to another part of the interface, you need to edit - from the Design section of the administration panel, the following files:
- index.php: home page or page categories.
- single.php: article page .
- header.php: common title for all pages .
- footer.php: total footnote.
- style.css - style sheet .
To change the style element, you must find the selector name in the page source.
Knowledge of the PHP language is optional if you follow these instructions...
Change title
The title is managed by Wordpress and repeated by the theme. We go to the general section of the administration (setting), where you can change the name and slogan.
If you want to replace the title with a logo, this is done in the style sheet.
Remove Author
If the site is not collaborative, the author's name will always be the same and unnecessarily displayed under each title. Encoded in single.php like this:
<p class="post-info">Posted by <?php the_author(); ?> | Filed under <?php the_category(', ') ?></p>
Which will be replaced by:
<p class="post-info">Catégorie <?php the_category(', ') ?></p>
Same in index.php
Change Date Format
This theme does not repeat the date format specified in the Dashboard, you need to change it directly in index.php and single.php .
<span class="date"><?php the_time('F jS, Y') ?></span>
Enter the format specified in the panel, for example:
<span class="date"><?php the_time('j F Y') ?></span>
This will be shown on May 1, 2009.
Other translations
«Read the rest of the article». This message has been changed in index.php:
<?php the_content('Read the rest of this entry »'); ?>
Replace the wording with "Continue" or whatever you want.
Move Recent Articles List
She appears in a T-shirt, which has the disadvantage of making her appear on the homepage where she is superfluous. Why not show it after the content of the articles?
We just delete the code in footer.php and add it to single.php.
Then we will have single.php:
<h3>Recent Posts</h3> <ul class="col-list"> <?php wp_get_archives('type=postbypost&limit=10'); ?> </ul> <!-- main ends -->
You can go back to style or not and change the name to h3 if you want to franize.
The same can be done with the list of recent comments, where to delete if it is considered superfluous. But this one would be happier on the homepage than on the article pages. Then the placement in index.php follows the same principle .
No comment
If the site does not allow comments (too much spam), how to get rid of mentions of them? Show on each post "Comments are not allowed" unnecessarily negative.
We remove this part of the code in index.php:
<?php comments_popup_link('Comments (0)', 'Comments (1)',
'Comments (%)', 'comments', 'Comments off'); ?> |
In single.php, you can delete:
<?php comments_template(); ?>
Edit Meta Section
It contains a link to the login page, as well as several links that we could handle. There is no reason to have a link to Wordpress on every page of the site, we know where to find it if you need it. But how do you delete a link in a meta widget?
First decision
The solution is simple: remove the widget and add a text widget, which we will fill with useful links...
Insert the following code:
<ul>
<li> <a href="https://www.iqlevsha.ru/wp-login.php">Login</a> </li> <li> <a href="https://www.iqlevsha.ru/feed">RSS</a> </li>
</ul>
The domain will be your site.
Second solution to 2.8
A better but slightly more complex method.
In wp-includes, edit the widgets.php file.
In the function wp_widget_meta ($ args) {
Delete this row:
<li><a href="http://wordpress.org/" title="<?php echo attribute_escape(__('Powered by... ')); ?>"> WordPress.org</a></li>
You can also delete the previous line for RSS2, the flow of recent comments.
As of Worpdress 2.8
In wp-includes, edit the default-widgets.php file
In the WP_Widget_Meta class and method widget, remove the reference as above .
Into subject
Perhaps the theme does not use the widget, but places links directly into the sidebar.php file.
In this case, you need to edit this file directly with the built-in theme editor.
Change Title Image
The image of the title in Colourise generously takes up half a page, and we will also rush to reduce its height .
Most themes do not have a style setting to display in the body of the image, which is actually the background of the header, and this theme, unfortunately, repeats this vice. To have a menu at the top on a black background, therefore, the image must have a black field, and in this field it is given a height of 78 pixels.
The total height, for example, is reduced to 240 pixels, and the image is recorded under the same name instead of bg.jpg in the theme image folder.
You then modify the style sheet accordingly.
Link to home page
In header.php, just such code:
<div id="nav"> ....
<a href="<?php echo get_option('home'); ?>">Home</a>
You can franc by replacing Home (wording) with Home.
Football player
You can reduce its height by deleting the lists it contains. This is done in a style sheet.
Change colors
Do we prefer a white background? Edit style.css.
Change the background color from black to white:
body {
background-color:black;
}
Headlines here:
#header h1#logo-text a { ... }
#main h2 { ... }
See source code for style names to find them in style.css.
See also
- Install WordPress locally to run tests. And develop a theme.
- CSS syntax. Introduction to web page style sheets.