To add your own sidebar content without creating your own widget you can do the following: add_shortcode('MY_SIDEBAR_CONTENT', 'my_sidebar_content'); add_filter('widget_text', 'my_custom_text_widget_shortcodes'); function my_custom_text_widget_shortcodes($text){ ?> ADD YOUR CONTENT HERE <?php //To allow other text from the widget text box to be shown we need to strip out our shortcode and return what's left $text = str_replace('[MY_SIDEBAR_CONTENT]', '', […]
Category: Child Themes
Add your own footer into footer.php
To avoid needing to copy the footer.php file into your child theme and customize it you can use a function in your child theme functions.php file instead: add_action('wp_footer', 'my_custom_footer'); function my_custom_footer(){ //Close PHP tags ?> ADD YOUR PLAIN HTML CODE HERE <?php //Open PHP tags }
Add your own header into header.php
To avoid needing to copy the header.php file into your child theme and customize it you can use a function in your child theme functions.php file instead: add_action('wp_head', 'my_custom_header'); function my_custom_header(){ //Close PHP tags ?> ADD YOUR PLAIN HTML CODE HERE <?php //Open PHP tags }
Using Google Fonts
In a functions.php file use this: function add_google_fonts() { wp_register_style('GoogleFonts', 'http://fonts.googleapis.com/css?family=Coda|Contrail+One'); wp_enqueue_style('GoogleFonts'); } add_action('wp_print_styles', 'add_google_fonts'); Change the font names to the name you wan to us and separate multiple fonts with a '|' character
.Create A Child Theme
Creating A Child Theme This allows you to modify a main theme but still allow the main theme to be updated. The main guide: http://codex.wordpress.org/Child_Themes Creating The New Theme 1. Creat a new directory for the child theme, typcially “main_theme_name-child” 2. Create a file called “style.css” and paste this into it: Change to match the theme […]