Difference between revisions of "WP THEME"
From KOP KB
(→Custom Theme Page) |
|||
| Line 12: | Line 12: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
SOURCE: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/ | SOURCE: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/ | ||
| + | |||
| + | =Adding Header Image Function= | ||
| + | <syntaxhighlight lang="php"> | ||
| + | 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 ); | ||
| + | </syntaxhighlight> | ||
Revision as of 19:53, 9 March 2016
This will be about certain codings to customize your wordpress theme even further.
Custom Theme Page
When you add a new page in wordpress you can choose a template on the right hand side. If you upload a php file with a custom template for a page and provide the template name it will show up in the dropdown list.
<?php
/**
* Template Name: Full Width Page
*
*/
SOURCE: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
Adding Header Image Function
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 );