Category, tags and CPT’s taxonomy archive pages are only showing the intro text. Following code is showing the default WordPress taxonomy description when you are not using the intro text. If you have both (Description and intro text) then intro text will display. Checkout this gists.
Genesis
Simple Social Icons Color Style Saver Scripts
If you use Simple Social Icons widget at multiple widget areas on your site, it is always taking the last widget settings (Background color, font color, border color etc). I solved this problem today. I added the following scripts in functions.php file:
Adding Home Section 1 and 2 to all pages on Parallax Pro Theme
Step 1: Replace the current front-page.php file’s code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
<?php /** * This file adds the Home Page to the Parallax Pro Theme. * * @author StudioPress * @package Parallax * @subpackage Customizations */ add_action( 'genesis_meta', 'parallax_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function parallax_home_genesis_meta() { if ( is_active_sidebar( 'home-section-1' ) || is_active_sidebar( 'home-section-2' ) || is_active_sidebar( 'home-section-3' ) || is_active_sidebar( 'home-section-4' ) || is_active_sidebar( 'home-section-5' ) ) { //* Add parallax-home body class add_filter( 'body_class', 'parallax_body_class' ); function parallax_body_class( $classes ) { $classes[] = 'parallax-home'; return $classes; } //* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Remove primary navigation remove_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' ); //* Remove breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs'); //* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); //* Add homepage widgets add_action( 'genesis_loop', 'parallax_homepage_widgets' ); } } //* Add markup for homepage widgets function parallax_homepage_widgets() { genesis_widget_area( 'home-section-3', array( 'before' => '<div class="home-odd home-section-3 widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-section-4', array( 'before' => '<div class="home-even home-section-4 widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-section-5', array( 'before' => '<div class="home-odd home-section-5 widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); } genesis(); |
Step 2: Open your functions.php file and add the following code inside the parallax_enqueue_scripts_styles() function :
1 2 3 4 5 |
if ( ! wp_is_mobile() ) { wp_enqueue_script( 'parallax-script', get_bloginfo( 'stylesheet_directory' ) . '/js/parallax.js', array( 'jquery' ), '1.0.0' ); } |
So here is the complete code of parallax_enqueue_scripts_styles() function :
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function parallax_enqueue_scripts_styles() { if ( ! wp_is_mobile() ) { wp_enqueue_script( 'parallax-script', get_bloginfo( 'stylesheet_directory' ) . '/js/parallax.js', array( 'jquery' ), '1.0.0' ); } wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION ); } |
Lastly add this new code in functions.php file :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//* Display Home Section 1 and Section 2 to all pages add_action( 'genesis_after_header', 'parallax_home_section', 7 ); function parallax_home_section() { if ( ( is_active_sidebar( 'home-section-1' ) || is_active_sidebar( 'home-section-2' ) ) && ( is_singular('page') || is_home() ) ) { genesis_widget_area( 'home-section-1', array( 'before' => '<div class="home-odd home-section-1 widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-section-2', array( 'before' => '<div class="home-even home-section-2 widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); } } |
All are done. Now browse your site and… Continue Reading
Making Category Archive Page in Gallery Format
Step 1: Add this following code in your functions.php file : Step 2: Create a new js file “hover.js” and put in “your-child-theme-folder/js” folder. Now add this scripts into this file:
1 2 3 4 5 6 7 |
jQuery(document).ready(function($){ $(".col-3").hover(function(){ $(this).find('.entry-header').fadeIn(); },function(){ $(this).find('.entry-header').fadeOut(); }); }); |
Step 3: Loading this new JS file on your site using wp_enqueue_scripts function. Add the following php code in your functions.php file. This… Continue Reading
Search Input Box on Slider Using Flex Pro Theme
In this article I am showing how to accomplish this. Flex Pro theme have slider CPT. Step 1: Navigate to Dashboard > Slider > Add New page and change the WP Editor mode from Visual to Text. Now create a slider post and put the following HTML markup in WP Editor.
1 2 3 4 5 6 |
<div class="slider-search-form"> <form role="search" action="/" class="search-form" method="get"> <label class="screen-reader-text">Search site</label> <input type="search" placeholder="Type and press Enter" name="s"> <input type="submit" value="Search"></form> </div> |
So Edit screen… Continue Reading
Embed video above the Featured Post Title
This tutorial is for above user. But it will be very helpful for other Genesis folks. Step 1: Creating a custom field “video_embed_code” using WP’s Native Custom Fields feature. Go to post’s add/edit screen page and scroll down. You will get “Custom Fields” box. if it is not coming then click on “Screen Options” tab… Continue Reading
Adding categories and tags to pages
In this article I am showing how to add the category and tags to pages. First registering the category and tags taxonomy to “page” type by init and register_taxonomy_for_object_type functions. After adding this code “Categories” and “Tags” meta box will appear on Page Add/Edit Screen at Dashboard.
1 2 3 4 5 6 7 8 9 10 |
/** Enabling Categories and Tags Taxonomy for pages at Add/Edit Screen * * @since 1.0 * */ add_action('init', 'gd_register_category_tags_taxonomy_for_page'); function gd_register_category_tags_taxonomy_for_page() { register_taxonomy_for_object_type('post_tag', 'page'); register_taxonomy_for_object_type('category', 'page'); } |
Adding opening and closing footer markup. genesis_page_entry_footer_markup_open… Continue Reading
Different Primary Menu on Pages using Altitude PRO Theme
I did this by following steps: Step 1: First creating a default primary menu. Navigate to Appearance > Menus and create a default primary menu for your site. Check the “Primary Navigation Menu” checkbox and save this menu. Step 2: Creating another menu for pages only. Navigate to Appearance > Menus and create another menu… Continue Reading
How to only show a featured image if it was set in post?
Normally genesis_get_image() is fetching the first image if you are not setting any featured image for your post. But sometime we are not wanting this default option. Using this simple code you can disable this:
1 2 3 4 5 6 |
add_filter( 'genesis_get_image_default_args', 'gd_show_only_assigned_featured_image' ); function gd_show_only_assigned_featured_image( $args ){ $args['fallback'] = 'no-attachment'; // By Default it is 'first-attached' return $args; } |
Adding Primary Sidebar to Whitespace PRO
NOTE: I did not add the responsive effect. You will take care about responsive effect. Sharing the basic steps here: Step 1: Enabling the Content Sidebar Layout option. Edit the functions.php file. Open the functions.php file on Notepad+ or navigate to Appearance > editor and click on functions.php link. Now modified the following codes: Current… Continue Reading