fbpx
  1. Home
  2. Developer
  3. Page 3

Chapter: Developer

Snippets, actions, filters, examples of changing theme using code

Add theme metaboxes and theme settings metaboxes CPT

If you’d like to enable the ‘Theme Options Panel’ for a custom post type then add the below code your your KLEO child themes functions.php file. // Add Theme Settings to CPT // function my_cpt_sq_metabox_general_settings($post_types) { $post_types[] = ‘yourCPTslug’; return $post_types; } add_filter(‘sq_metabox_general_settings’, ‘my_cpt_sq_metabox_general_settings’); Note: replace yourCPTslug with the slug for your custom post type. More information For more information […]

BuddyApp Theme Hooks

Actions used in BuddyApp template: kleo_header – Used to add the header to the page – @hooked kleo_show_header kleo_before_main – goes inside div#main; after Header and Breadcrumb section kleo_before_content – render something before the main content and sidebar kleo_before_main_content – render something above the main content only kleo_after_main_content – render something below the main content only kleo_after_content – render something […]

Font Icons

BuddyApp uses IcoMoon for Vector icons. To see the icons that are included follow the next steps: 1. Go to the main package downloaded 2. Go to Assets/Fonts folder and open demo.html To extend the fonts you can put your own icomoon files in the child theme inside the assets/fonts folder. If the folder structure is missing you just need […]

BuddyApp & WP Engine

If your BuddyApp site is hosted with WP Engine then you will need some minor changes to make BuddyPress work seamlessly. This is a problem that is not related to the theme but something that has to do with WP Engine system. 1. Activate your BuddyApp Child theme if it is not already enabled. 2. Go to WP Admin > […]

Right Hand DropDown Menu Cut Off

#menu-primary-menu.nav.navbar-nav li:hover ul{ left:auto; right:0; margin-right:-10px; } Add this snippet to style.css of child theme to fix the Right Hand DropDown Menu Cut Off Thanks you, zzkamikazezz for the snippet

Show featured image full width before the content area

The code will be added to wp-content/themes/kleo-child/functions.php add_action( ‘kleo_before_main’, ‘sq7rdu_show_featured_before_content’ ); function sq7rdu_show_featured_before_content() { if ( is_single() && has_post_thumbnail() ) { echo ”; the_post_thumbnail( ‘full’ ); echo ”; } } Below is a screenshot with an example of the function usage.

Use custom fontello font icons for in Kleo Theme

You can import additional font icons like this: 1. Go to http://fontello.com 2. Click on this icon from middle page then press import   3. Go to main zip file that you have downloaded from Themeforest in this path : /MainFiles/Assets/Fontello 4. Import/upload config.json 5. Icons from KLEO will appear and you can select additional icons 6. When you are done […]

Add Extra Membership Levels Fields

To add extra fields to membership levels, follow this example: We add a new MESSAGES RESTRICTION and SHOP. The following codes goes to kleo-child/functions.php This manipulates the text that shows in the memberships page: /* These restrictions will appear to be configured in Theme options – Memberships */ add_filter(‘kleo_pmpro_level_restrictions’, ‘kleo_my_levels_checkmarks’); function kleo_my_levels_checkmarks($settings) { $settings = array ( //NEW RESTRICTION MESSAGES […]

Change KLEO Page Title for Archives and Other WordPress Pages

For KLEO we have created a function that generates the titles for all WordPress specific pages. You just need to redefine this function in your child theme/functions.php and rename the strings. Make sure to have the child theme activated. //Add me to child theme functions.php function kleo_title() { $output = “”; if ( is_category() ) { $output = __(‘Archive for […]

How to add a Populated Country List XPROFILE

Hello everyone, this topic is for those who want to have an already populated country list to user xprofile fields instead of adding one by one. Just edit the child theme file “functions.php” and paste the following code: /* If you are using BP 2.1+, this will insert a Country selectbox. Add the function to bp-custom.php and then visit …/wp-admin/users.php?page=bp-profile-setup […]