View htaccess-rules
Negative lookahead based rule:
RewriteRule ^products/(?!certain-category).*$ http://shop.newurl.co.uk/ [NC,L,R=301]
(?!certain-category) is a negative lookahead that will fail the match if certain-category comes right after /products/ in URL.
RedirectMatch 301 /products(.*) http://shop.sunwise.co.uk/
Redirect 301 /shop http://shop.sunwise.co.uk
View wp-process-remove_unwanted_shortcode_tags
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
function wpse_wpautop_nobr( $content ) {
return wpautop( $content, false );
}
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
View wp-filter-add_custom_image_sizes
/**
* Adding Custom Images Sizes to the WordPress Media Library
*
* @access public
* @param array $sizes
* @return array
*/
function shgist_add_image_sizes($sizes) {
$addsizes = array(
"new-size" => __( "New Size")
View wp-action-modify_the_post_object
/**
* Modify the WordPress post object
*
* @param obj $post_object
* @return obj
*/
function shgist_my_the_post_action( $post_object ) {
// modify post object here
}
add_action( 'the_post', 'shgist_my_the_post_action' );
View wp-filter-modify_nav_menu_objects
/**
* Modify WordPress nav menu objects
*
* @param array $menu_items
* @return array
*/
function shgist_nav_menu_item_classes( $menu_items ) {
foreach ( (array) $menu_items as $key => $menu_item ) {
// Work on menu item objects
View wp-func-get_child_pages
/**
* Get child pages
*
* @access public
* @return array
*/
function shgist_get_child_pages() {
global $post;
$args = array(