• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WordPress Tips, Code Snippets, and How To Tutorials

  • Home
  • Blog
  • Tips
  • Snippets
  • Tutorials
  • Contact

Templates

How to remove the breadcrumbs from WooCommerce products on WordPress

November 7, 2019 by admin Leave a Comment

If you are using WooCommerce on your WordPress website you may want to remove the breadcrumbs from the products on there. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to the file on there.

Remove WooCommerce breadcrumbs

/**
 * Remove product breadcrumbs
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function remove_woo_breadcrumbs() {
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
add_action( 'init', 'remove_woo_breadcrumbs' );

Now if that works for you it would remove the breadcrumbs from the WooCommerce products on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Links, Templates, WooCommerce, WordPress Admin, WordPress Theme

How to update the number of WooCommerce products on each page on WordPress

November 7, 2019 by admin Leave a Comment

On your WooCommerce store on your WordPress website you may want to update or change the number of WooCommerce products on each page of the website. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

Update how many products display on each WooCommerce page on WordPress

/**
 * Update products per page
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return #;' ), 20 );

You can then replace the # with the number of products you want per page. Now if that works for you it would update the number of WooCommerce products on each page on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Templates, WooCommerce, WordPress Admin, WordPress Theme

How to change the length of the default WordPress excerpt length

October 31, 2019 by admin Leave a Comment

If you are using WordPress for your website you may want to change the length of the default excerpt. You can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to that on there.

/**
 * Update default excerpt length
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function the_excerpt_length($length) {
     return #;
}
add_filter('excerpt_length', 'the_excerpt_length');

Then you replace the # with the number of the new length you want the except to be on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Templates, WordPress Admin, WordPress Theme

How to exclude or remove the posts of one category from WordPress blog feed on front home page

October 29, 2019 by admin Leave a Comment

If you are using WordPress for your website you may want to exclude or remove the posts from one category of your blog from the blog feed on your website on the front page there. You can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it on there.

/**
 * remove category from blog feed on front page
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function remove_category_from_blog( $query ) {
    if( $query->is_main_query() && $query->is_home() ) {
        $query->set( 'cat', '-#' );
    }
}
add_action( 'pre_get_posts', 'remove_category_from_blog' );

You can then replace the # with the id number of the category you want to remove from it. This post may help you to find the category id number on there. Now if that works for you it would remove that category from the blog feed on the front page of your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Blog, Categories, Functions.php, Templates, WordPress Admin, WordPress Theme

How to add the sidebar to the front page of your StudioPress Genesis theme on WordPress

October 29, 2019 by admin Leave a Comment

Do you want to add the sidebar to the front page of your WordPress website on your StudioPress Genesis theme on there? If you do you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

/**
 * Add sidebar to front page
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function add_sidebar_to_front_page() {
    if ( is_home() ) {
        return 'content-sidebar';
    }
}
add_filter( 'genesis_pre_get_option_site_layout', 'add_sidebar_to_front_page' );

Now if that works for you it would add the sidebar to the front page of your StudioPress Genesis theme on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Formatting, Functions.php, Sidebar, StudioPress Genesis, Templates, WordPress Theme

How to add a widget area to the top of a WordPress website before the header in a StudioPress Genesis theme

October 29, 2019 by admin Leave a Comment

You may want to add a widget area to the top of your WordPress website in your StudioPress Genesis theme. In order to add a widget area to your StudioPress Genesis theme without using a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

/**
 * Add widget before the header
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
genesis_register_sidebar( array(
	'id'          => 'widget-before-header',
	'name'        => __( 'Before Header Widget', 'yourtheme' ),
	'description' => __( 'This is the widget before the header.', 'yourtheme' ),
) );
function addwidgetbeforeheader() {
	genesis_widget_area( 'widget-before-header', array(
			'before' => '<div class="widget-before-header widget-area">',
			'after'  => '</div>',
		) );
}
add_action('genesis_before_header', 'addwidgetbeforeheader');

If you want to style the widget you can do that in css using .widget-before-header in your stylesheet or you can read this post on how to style your custom widget area on your website for more information on how to do that on there. You can replace the yourtheme title with the name of your WordPress theme.

Now if that works for you it would add the new widget area to your StudioPress Genesis theme at the top of your website before the header on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Header, StudioPress Genesis, Templates, Widgets, WordPress Admin, WordPress Theme

How to add a widget area before the footer of your StudioPress Genesis theme on WordPress

October 29, 2019 by admin Leave a Comment

If you are using a StudioPress Genesis theme on your WordPress website you may want to add a widget area before the footer. You can then add this code to your functions.php file to add a widget area before the footer of your StudioPress Genesis theme without using a plugin on there. It may be a good idea to backup your WordPress website before you make updates to it on there.

/**
 * Add widget area before footer
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
genesis_register_sidebar( array(
	'id'          => 'widget-before-footer',
	'name'        => __( 'Before Footer Widget', 'yourtheme' ),
	'description' => __( 'This is the widget before the footer.', 'yourtheme' ),
) );
function addwidgetbeforefooter() {
	genesis_widget_area( 'widget-before-footer', array(
			'before' => '<div class="widget-before-footer widget-area">',
			'after'  => '</div>',
		) );
}
add_action('genesis_before_footer', 'addwidgetbeforefooter');

If you want to style the widget you can do that in css using .widget-before-footer in your stylesheet or you can read this post on how to style your custom widget area on your website for more information on how to do that on there. You can replace the yourtheme title with the name of your WordPress theme.

Now if that works for you it would add the new widget area to your StudioPress Genesis theme before the footer on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Footer, Functions.php, StudioPress Genesis, Templates, Widgets, WordPress Theme

How to add a widget area after blog posts in WordPress in a StudioPress Genesis theme

October 29, 2019 by admin Leave a Comment

If you are using WordPress with a StudioPress Genesis theme you may want to add a widget area after your blog posts. If you want to add a widget area to your StudioPress Genesis theme without using a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

/**
 * Add widget area after blog posts
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
genesis_register_sidebar( array(
	'id'          => 'widget-after-posts',
	'name'        => __( 'After Posts Widget', 'yourtheme' ),
	'description' => __( 'This is the widget after blog posts.', 'yourtheme' ),
) );
function addwidgetafterblogposts() {
	genesis_widget_area( 'widget-after-posts', array(
			'before' => '<div class="widget-after-posts widget-area">',
			'after'  => '</div>',
		) );
}
add_action('genesis_after_entry_content', 'addwidgetafterblogposts');

If you want to style the widget you can do that in css using .widget-after-posts in your stylesheet or you can read this post on how to style your custom widget area on your website for more information on how to do that on there. You can replace the yourtheme title with the name of your WordPress theme.

Now if that works for you it would add the new widget area to your StudioPress Genesis theme after your blog posts on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, StudioPress Genesis, Templates, Widgets, WordPress Admin, WordPress Theme

How to upload a new theme to your WordPress website to change or update your theme to

October 26, 2019 by admin Leave a Comment

If you are using WordPress for your website you may have downloaded a new theme that you would like to use for your website design and layout. That is easy to do with WordPress. You may want to backup your website before you update it.

To upload your theme to your website you can click on appearance > themes then click the add new button then from that page click the upload theme button. Then you browse on your computer to find the zipped theme folder.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tips Tagged With: Templates, WordPress Admin, WordPress Theme

How to change or update your WordPress theme to a new different one

October 26, 2019 by admin Leave a Comment

If you are using WordPress for your website you may want to update your theme to a new one. That is easy to do with WordPress. You may want to backup your website before you update it.

To change or update your WordPress theme to a different one you can click on appearance > themes then pick a theme from the list there. If you want to install a new theme you can click the add new button then pick a theme from the wordpress.org themes or you can click the upload theme button to upload one you have downloaded to your computer.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tips Tagged With: Templates, WordPress Admin, WordPress Theme

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

Hey, We Deliver... Anywhere!

Enter Email Address below to receive our snacks via email:

Join Over 1200 Readers!

Jump To A Random WordPress Tip

Copyright © 2019 • wpsnacks.com