Add this to functions.php for JS and CSS. Check out the WordPress Codex for available parameters and info on using the ‘$’ namespace for jQuery. <?php function wnt_styles(){ // STYLES wp_register_style(‘bootstrapcss’, get_template_directory_uri() . ‘/css/bootstrap.css’, array(), ‘20140529’, ‘all’ ); wp_enqueue_style(‘bootstrapcss’); } add_action(‘wp_enqueue_scripts’, ‘wnt_styles’); wp_enqueue_script(‘jquery’); // This is all that’s needed for jQuery since WordPress already has […]
Use child themes to avoid losing changes when themes are updated by their vendors. Create a new theme folder with the same name as its parent, plus “-child” appended to it Create a style.css file with at least the following three required lines… Theme Name (ex.Theme Name: Twenty Fourteen Child) … NOTE: No spaces allowed […]
<?php echo do_shortcode(“[shortcode]”); ?>
Add this to functions.php… function my_widget_tag_cloud_args( $args ) { // Your extra arguments go here $args[‘number’] = 999; return $args; } add_filter( ‘widget_tag_cloud_args’, ‘my_widget_tag_cloud_args’ ); Resources Tag Cloud Defaults
Control the number of search or post tag results in WordPress by adding the following just before “<?php if (have_posts()) : ?>” in search.php and/or archive.php… <?php query_posts($query_string . ‘&showposts=25’); ?> Resources WordPress Codex: Tag Templates
Add to the theme’s functions.php file… function admin_bar_custom_links(){ global $wp_admin_bar; if(!is_super_admin() || !is_admin_bar_showing()){ return; } $wp_admin_bar->add_menu(array( ‘id’ => ‘all_posts’, ‘title’ => __(‘All Posts’), ‘href’ => __(‘http://webninjataylor.com/library/wp-admin/edit.php’), )); // Add sub menu link $wp_admin_bar->add_menu( array( ‘parent’ => ‘all_posts’, ‘id’ => ‘all_pages’, ‘title’ => __( ‘All Pages’), ‘href’ => __(‘http://webninjataylor.com/library/wp-admin/edit.php?post_type=page’), )); } add_action(‘admin_bar_menu’,’admin_bar_custom_links’,25); Change parent, id, title, […]
The functions.php file cannot have any spaces at the end.
Remove HTML <!– comments –> from your WordPress content. WordPress seems to choke on it and remove content following the comment even though it’s closed properly.
Disable under Settings > Discussion Remove this code from page.php… <?php comments_template( ”, true ); ?>
Add this to your theme’s functions.php file… /******** ADD CUSTOM STYLES TO TINYMCE EDITOR ********/ add_filter(‘mce_buttons_2’, ‘my_mce_buttons_2’); function my_mce_buttons_2($buttons) { array_unshift($buttons, ‘styleselect’); return $buttons; } add_filter(‘tiny_mce_before_init’, ‘my_mce_before_init’); function my_mce_before_init($settings) { $style_formats = array( array( ‘title’ => ‘Button’, ‘selector’ => ‘a’, ‘classes’ => ‘button’ ), array( ‘title’ => ‘Callout Box’, ‘block’ => ‘div’, ‘classes’ => ‘callout’, […]
WordPress Backup to Dropbox (for backing up data; otherwise, use GitHub for theme files) MarketPress Akismet Form Manager NextGEN Gallery NextGEN Galleryview ShareThis P3 – Plugin Performance Profiler: Analyzes how fast your page loads and which plugins are slowest
Installing online (via admin interface browsing to a zip file) is the same as uploading the unzipped theme directly Theme files can be edited directly within the admin interface style.css holds all the meta info the site needs functions.php is the heart of the theme Link to theme images using PHP to keep everything relative […]