Category: Snippets

Add An Edit Link to WordPress Posts

If you spot some content or a post title that needs updating, it’s nice to have an edit link to quickly access the edit page. … View More

How To Programmically Remove Widgets From Sidebar

You can manually remove Widgets through the admin settings, but to remove them as an option you would add the following to your child theme… View More

Disable Organize My Uploads In WordPress Programmically

By default, WordPress uploads media files into folders organized by month and year.  You can disable this by visiting Settings > Media and unchecking this… View More

Define WordPress Permalink Structure Programmically

If you create a lot of WordPress sites or are creating a custom theme, and always want the structure of your permalinks the same, you… View More

How To Disable Archive Pages In WordPress

Aside from being bad for SEO (due to duplicate content), most websites don’t need content alternately organized by month, author, category and tag. [php] ///////////… View More

How To Display Title As A Link In WordPress

[php] echo ‘<div class=”view-full-post”><h1><a href=”‘ . get_permalink() . ‘”>’ . get_the_title() . ‘</a></h1></div>’; [/php]

Disable All Comments And Access In WordPress

Full credit to Matt Clements https://gist.github.com/mattclements/eab5ef656b2f946c4bfb [php] /////////// // Disable Comments /////////// // Add to existing function.php file // Disable support for comments and trackbacks… View More

Add Font Awesome To WordPress

[php] ////////// // Add Font Awesome Stylesheet ////////// wp_register_style( ‘Font_Awesome’, ‘https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css’ ); wp_enqueue_style(‘Font_Awesome’); [/php]

Add Google Fonts To WordPress

[php] /////////////////// // Add Google Fonts ////////////////// function custom_add_google_fonts() { wp_enqueue_style( ‘custom-google-fonts’, ‘https://fonts.googleapis.com/css?family=Lato:300,400,400i’, false ); } add_action( ‘wp_enqueue_scripts’, ‘custom_add_google_fonts’ ); [/php]