Difference between revisions of "Wordpress Custom Themes"
(Created page with "== Intro == Basically some simple info about making and starting to create your own Wordpress template. == Basic Requirements == The files that you can use with a Wordpress T...") |
(→Simple Header Image) |
||
Line 15: | Line 15: | ||
Now there is definitely other ways to do these things but this is the way I managed. | Now there is definitely other ways to do these things but this is the way I managed. | ||
===Simple Header Image === | ===Simple Header Image === | ||
− | Basically just adding a header image option for the top of each page. Lets you set the height and width was well where the default image gets set. This code would be within the functions.php file within your Theme folder. | + | Basically just adding a header image option for the top of each page. Lets you set the height and width was well where the default image gets set. This code would be within the functions.php file within your Theme folder. Pretty much the function is all the dirty work and the them support part says start it up. |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
Line 28: | Line 28: | ||
); | ); | ||
add_theme_support( 'custom-header', $args ); | add_theme_support( 'custom-header', $args ); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Login Page === | ||
+ | Login related functions and edits | ||
+ | ====Locking it Down==== | ||
+ | Pretty much only time you really want login errors to show is when your testing something out, otherwise wordpress lets on too much. This command in the functions.php hides them. You can use css to hide it completely or just null the message and still have the red bar show up. | ||
+ | |||
+ | <syntaxhighlight lang="php"> | ||
+ | add_filter('login_errors',create_function('$a', "return null;")); | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 18:19, 17 January 2017
Contents
Intro
Basically some simple info about making and starting to create your own Wordpress template.
Basic Requirements
The files that you can use with a Wordpress Template that are integrated are listed here: https://codex.wordpress.org/Theme_Development
The ones that are absolutely required for wordpress admin panel to recognize it is below:
style.css index.php
This is a very basic one and if you feel like you need more functionality you can look through the link above.
Functions and Styles
Now there is definitely other ways to do these things but this is the way I managed.
Simple Header Image
Basically just adding a header image option for the top of each page. Lets you set the height and width was well where the default image gets set. This code would be within the functions.php file within your Theme folder. Pretty much the function is all the dirty work and the them support part says start it up.
function register_my_menu() {
register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_my_menu' );
$args = array(
'width' => 960,
'height' => 198,
'default-image' => get_template_directory_uri() . '/images/header.jpg'
);
add_theme_support( 'custom-header', $args );
Login Page
Login related functions and edits
Locking it Down
Pretty much only time you really want login errors to show is when your testing something out, otherwise wordpress lets on too much. This command in the functions.php hides them. You can use css to hide it completely or just null the message and still have the red bar show up.
add_filter('login_errors',create_function('$a', "return null;"));