Editing wordpress theme without edit the origin theme file

Editing wordpress theme without edit the origin theme file. There are many way to castumize wordpress theme. One of them is using child themes ( http://codex.wordpress.org/Child_Themes ). As wordpress said, child themes are the recommended way of making modifications to a theme if you want your modifications are still there. To start editing please follow Codex wordpress on http://codex.wordpress.org/Child_Themes , or follow this steps :
*this example using fastfood theme as original theme.

  • Create directory in themes directory, for example fastfood-child
  • Create style.css and import the fastfood theme style, look at the code below
/*
Theme Name:     fastfood Child
Theme URI:      http: //mendoan.us/
Description:    Child theme for the fastfood theme 
Author:         securesh
Author URI:     http: //kencur.net/about/
Template:       fastfood
Version:        0.1.0
*/

@import url("../fastfood/style.css");

/*
body {
	background: #C0C0C0;
}
*/
  • To support RTL languages, add rtl.css file to your child theme
/*
Theme Name:     fastfood Child
Template:       fastfood
*/

@import url("../fastfood/rtl.css");
[/sourcecode]


For example if you want add a meta tag from search engine verification and add the favicon or icon for your web : create functions.php in child theme directory, and paste this code

<?php
function favicon_link() {
?>
<link rel="shortcut icon" type="image/x-icon" href="your image" />
<?php
}
add_action('wp_head', 'favicon_link');
function seoverify() {
?>
<your meta code>
<meta name="msvalidate.01" content="your validation" />
<?php
}
add_action('wp_head', 'seoverify');
?>

To use the child theme just activate your child theme from wp-admin.
You are don :)

Published by

0 0 vote
Article Rating
Subscribe
Notify of
guest
7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Amri
9 years ago

Simpen dulu cur, dadi dulu sebenenya pengen bleajar buat/edit themes wordpress. :D