Skip to content

Instantly share code, notes, and snippets.

@WordBits
WordBits / snippet.php
Created September 14, 2018 03:55
Displays a WordPress navigation menu as a simple bullet point list. Useful for automating a sitemap page or injecting into the footer. Usage: [rtpmenu name="somemenuname"] [rtpmenu name="somemenuname" menu_class="acustomclassforstyling"]
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/rtp-theme-cleaner/
// Created by: Matthew Harris
?>
<?php
function rtp_menu_shortcode($atts, $content = null) {
extract(shortcode_atts(array( 'menu' => null, 'menu_class' => 'rtpmenushortcode' ), $atts));
return wp_nav_menu(
@WordBits
WordBits / snippet.php
Created September 3, 2018 21:41
Piece of code that I use regularly to unregister a WordPress post type. Just add/edit/remove the post type from lines 3, 4 and 5 and paste in your functions.php file.
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/unregister-wordpress-post-types/
// Created by: Metal Potato
?>
<?php
function well_delete_post_type(){
unregister_post_type( 'portfolio' );
unregister_post_type( 'cms_block' );
unregister_post_type( 'uncode_gallery' );
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:59
ddddddddddd
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/fwefwefwefdddddddddd/
// Created by: jeffmatson
?>
<?php
echo '{%string:something%} {%string:another%}';
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:47
wefwefdsfsdfsdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/sddsafsdfwewe/
// Created by: jeffmatson
?>
<?php
echo '{%string:something%} {%string:another%}';
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:43
sdfasdfsdfsfsdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfdfadsfsdwewewess/
// Created by: jeffmatson
?>
<?php
echo '{%string:something%} {%string:another%}';
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:41
sdfasdfsdfsfsdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfdfadsfsdwewewe/
// Created by: jeffmatson
?>
<?php
echo '{%string:something%}';
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:39
sdfasdfsdfsfsdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfdfadsfsd/
// Created by: jeffmatson
?>
<?php
echo '{%string:something%}';
@WordBits
WordBits / snippet.php
Created August 29, 2018 03:14
dfadfadfafasdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/dsdsddsdsds/
// Created by: jeffmatson
?>
<?php
echo '{%string:something}';
@WordBits
WordBits / snippet.php
Created August 27, 2018 17:23
Creates shortcode to use in website footer to automatically update the copyright to current year.
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/current-year-copyright-shortcode/
// Created by: Tara Claeys
?>
<?php
function currentyear_shortcode() { $year = date('Y'); return $year; }
add_shortcode('currentyear', 'currentyear_shortcode');
@WordBits
WordBits / snippet.php
Created August 26, 2018 14:32
Removes the Generator meta tag that shows the WordPress version.
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/hide-generator-meta-tag/
// Created by: Topher DeRosia
?>
<?php
remove_action('wp_head', 'wp_generator');