WordPress site stuck in maintenance mode
If you are updating you plugins and your site is stuck in maintenance mode, you can just delete the .maintenance file in you site’s root directory and you are back online
Create custom page template for blog posts
If you want to create a custom page template for your blog posts, you can use this query so the pagination still works:
<?php query_posts( array( 'paged' => get_query_var('paged') ) ); ?>
In the bottom of the page, reset the query:
<?php wp_reset_query(); ?>
Change Breadcrumb Separator in Hybrid
Add this code to your function.php file
add_filter( 'breadcrumb_trail_args', 'my_breadcrumb_trail_args' );
function my_breadcrumb_trail_args( $args ) {
$args['separator'] = ' → ';
return $args;
}
Replace → with your own separator
Add WordPress Custom Header Image & Custom Background
In function.php files, use this code:
/* Add Custom Background */
add_custom_background();
/**
* Add support for WordPress custom header image. On that note, this is horrible and messy. Expect a
* rewrite of this entire code into something more beautiful in future versions.
*/
add_custom_image_header( '__return_false', '__return_false' );
define( 'NO_HEADER_TEXT', true );
define( 'HEADER_IMAGE', '' ); // By leaving empty, we allow for random image rotation.
define( 'HEADER_IMAGE_WIDTH', 960 );
define( 'HEADER_IMAGE_HEIGHT', 400 );
// Turn on random header image rotation by default.
add_theme_support( 'custom-header', array( 'random-default' => true ) );
register_default_headers( array(
'banner1' => array(
'url' => '%s/images/headers/banner1.jpg',
'thumbnail_url' => '%s/images/headers/banner1-thumb.jpg',
/* translators: header image description */
'description' => __( 'banner1', 'simplejoss' )
),
'banner2' => array(
'url' => '%s/images/headers/banner2.jpg',
'thumbnail_url' => '%s/images/headers/banner2-thumb.jpg',
/* translators: header image description */
'description' => __( 'banner2', 'simplejoss' )
)
) );
Display Product Category Description in Product page on woocommerce
You can use this code to display the product category description:
<?php global $post, $product;
$categ = $product->get_categories();
$term = get_term_by ( 'name' , strip_tags($categ), 'product_cat' );
echo $term->description; ?>
Online Shop Demo
Visit my online shop demo at http://demoshop.ericwijaya.com
This is my online shop demo page. You can browse through the products, try to buy some products, etc. If you want to get the feel of the online shop owner, you can register or contact me so I can give you the access to the online shop control panel. If you have any questions, feel free to send me an email to eric_wijaya_87@yahoo.co.id or put a comment in this post.
Recent Comments