WordPress Popular Posts is one of the most popular plugins for displaying popular posts (based on the number of views) in WordPress. This tutorial provides the steps to display 3 most popular posts in columns with image, title and category appearing one below the other in each post in a custom “Home Featured” widget area […]
Search Results for: wordpress
Taxonomy archive template to show CPT entries grouped by another taxonomy in WordPress
Scenario: CPT: books Associated Taxonomy 1: universe Associated Taxonomy 2: series Requirement: In universe taxonomy’s term archives, show books grouped by series. Here’s the PHP code in taxonomy-universe.php for this: To view the full content, please sign up for the membership. Already a member? Log in below or here. Username Password Remember Me […]
Querying multiple taxonomies in WordPress
Scenario: CPT: books Associated Taxonomy 1: universe Associated Taxonomy 2: series Requirement: For each universe show the books grouped by their series. Note: Unlike in the screenshot, the code below ensures that if there are no books in a series, the series name will not appear. Also, as can be seen, books were present only […]
How to load UIKit in WordPress
Looking to enqueue UIKit in your WordPress site? Add the following in your child theme’s functions.php: add_action( ‘wp_enqueue_scripts’, ‘custom_load_uikit’ ); /** * Load UIKit. */ function custom_load_uikit() { wp_enqueue_style( ‘uikit’, ‘//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/css/uikit.min.css’ ); wp_enqueue_script( ‘uikit’, ‘//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit.min.js’, array( ‘jquery’ ), ‘3.0.0.30’, true ); wp_enqueue_script( ‘uikit-icons’, ‘//cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit-icons.min.js’, array( ‘jquery’ ), ‘3.0.0.30’, true ); } Refer to https://getuikit.com/docs/installation for […]
How to remove Email and Website fields from Comment Form in WordPress
Looking to remove Email and Website/URL fields in your WordPress site’s comment form? Add the following in your child theme’s functions.php: add_filter( ‘comment_form_default_fields’, ‘comment_form_custom_fields’ ); /** * Remove Email and Website fields in comment form. * * @param array $args Default comment form arguments * @return array Modified comment form arguments */ function comment_form_custom_fields( $args […]
How to display posts grouped by year in WordPress
In a recent Genesis customization work I took up, the requirement was to display entries of a Custom Post Type grouped by years the posts were published in. The output needs to be the year the latest entry was published in, then an unordered list of titles linking to their permalinks for all entries published […]
How to load Bootstrap in WordPress
Adding the following in child theme’s functions.php will load Boostrap‘s minified CSS and JS files in the header and footer respectively in your WordPress site. add_action( ‘wp_enqueue_scripts’, ‘custom_load_bootstrap’ ); /** * Enqueue Bootstrap. */ function custom_load_bootstrap() { wp_enqueue_style( ‘bootstrap-css’, ‘//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css’ ); wp_enqueue_script( ‘bootstrap-js’, ‘//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js’, array( ‘jquery’ ), CHILD_THEME_VERSION, true ); } If CHILD_THEME_VERSION is not […]
How to show featured image of latest post for each unique posts published year in WordPress/Genesis
In a Genesis site that I am currently developing, there is an “Archive” page whose design looks like this: I could have simply hard-coded the images and the years and be done with the page in about 15 min. But I’ve decided to complicate things for myself and spent half a day making it dynamic […]
Custom SVG Social Sharing Buttons in WordPress
This tutorial provides the steps to set up custom SVG icon backgrounds as social sharing buttons using Naked Social Share WordPress plugin. Step 1 Install and activate Naked Social Share. Step 2 Go to Settings > Naked Social Share and adjust the settings to your liking. In this example, we are going to add the […]
Using Custom Menu for Social Media SVG Icons in WordPress
While using a plugin like Simple Social Icons is an option for displaying social icons, it is not easy or straight forward (from what I’ve seen) to replace icons of social networks that the plugin comes with. If you are looking to use your custom SVG social icons in a widget area, it’s easier to […]
Recent Comments