wp-bootstrap-comment-walker A custom WordPress comment walker class to implement the Bootstrap 3 Media object in wordpress comment list. Installation and Usage If you haven’t already add the HTML5 theme support for comment list, add this first in your functions.php function custom_theme_setup() { add_theme_support( ‘html5’, array( ‘comment-list’ ) ); } add_action( ‘after_setup_theme’, ‘custom_theme_setup’ ); Place class-wp-bootstrap-comment-walker.php in your WordPress theme folder /wp-content/your-theme/ […]
Shortcode Design Truth be told, I don’t really use the default WordPress shortcodes. However, many of the plugins I use provide their own shortcodes. Did you know that you too can create your own custom shortcodes? Typically, they come in 2 different designs Non-enclosed shortcode – [shortcode] Enclosed shortcode – [shortcode] The content [/shortcode] Create your very own custom […]
First Step: Use this code in functions.php function pr_post_view_count(){ if ( is_single() ){ global $post; $count_post = esc_attr( get_post_meta( $post->ID, ‘_post_views_count’, true) ); if( $count_post == ”){ $count_post = 1; add_post_meta( $post->ID, ‘_post_views_count’, $count_post); }else{ $count_post = (int)$count_post + 1; update_post_meta( $post->ID, ‘_post_views_count’, $count_post); } } } add_action(‘wp_head’, ‘pr_post_view_count’); Or use this code single.php if ( […]
/** * Register custom fonts. */ function themeslug_fonts_url() { $fonts_url = ”; $fonts = array(); $subsets = ‘latin,latin-ext’; /* * Translators: If there are characters in your language that are not supported * by Oswald, translate this to ‘off’. Do not translate into your own language. */ if ( ‘off’ !== _x( ‘on’, ‘Oswald font: […]
Why You Should Use WordPress Child Themes A child theme lets you modify a parent theme as much (or as little) as you want. You can then change the child theme without impacting the parent theme or any other projects using it as an anchor for its own child themes. How WordPress Child Themes Work […]
Are you looking for a way to start with a responsive navigation menu using Bootstrap? While there’s probably a plugin for this, we have created a quick code snippet that you can use to completely create a responsive WordPress menu using Bootstrap Nav Walker in WordPress. Instructions: First you need to download the wp_bootstrap_navwalker.php file […]
This tutorial will detail how to create a custom WordPress loop with pagination. To implement this custom loop, I will use WP_Query class to setup a new query, and then display the posts with pagination. Now remember that the default WordPress pagination (as implemented by Next Page and Previous Page) is easy to implement and […]
Are you looking for a way to display tags in an HTML list? This snippet will display your website’s tags in an unordered list with items that link to the corresponding tag page. Instructions: Simply copy and paste the following code wherever you want your tags to appear in your theme files. For further reading […]
In WordPress, breadcrumbs played an important role on the post page and also it’s help user to go back to previous page or home page. It make clear to user from where he/she come’s from, and where he/she right now. Breadcrumbs are navigational links, normally showing at the top of posts and pages. It is […]