fbpx
  1. Home
  2. Developer
  3. Page 2

Chapter: Developer

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

How to Delete the Link from the Website Logo

Copy the header.php of main theme and paste it at child theme, then edit it and find <a href=”<?php echo get_home_url(); ?>”><img id=”logo_img” src=”<?php echo sq_option(‘logo’,get_template_directory_uri().’/assets/images/logo.png’); ?>” width=”294″ height=”108″ alt=”<?php bloginfo(‘name’); ?>”></a> Replace it with <img id=”logo_img” src=”<?php echo sq_option(‘logo’,get_template_directory_uri().’/assets/images/logo.png’); ?>” width=”294″ height=”108″ alt=”<?php bloginfo(‘name’); ?>”>  

Full Width Profile Fields

If you have very long questions and answers and want to have both full width, with answers below questions, add the following to style.css of child theme: #buddypress div.profile .dl-horizontal dt { width: 100% !important; text-align: left !important; } #buddypress div.profile .dl-horizontal dd { margin: 0 auto !important; }  

How to Customize Women Online and Men Online Counters – WITHOUT ELEMENTOR

If you need to customize these counters because your website is not towards dating but maybe traveling, or if your website is in another language and so do are your profile fields, copy and paste the following shortcodes and fill the blank spaces with your own fields 🙂   [kleo_status_icon type=”custom” field=”YOUR CUSTOM FIELD HERE” value=”THE VALUE TO COUNT” online=”yes” […]

More Visible Discount Code Text (PMPRO Checkout)

By default at Paid Memberships Pro checkout, the discount code is small and difficult to see for the user. With this code, you can add color to it, change font size and weight. Before After To add a more visible discount code text, add this to style.css of child theme 🙂 p#other_discount_code_p { color: #2ba6cb; font-size: 12px; font-weight: 700; } […]

UberMenu Integration

KLEO works pretty much out of the box with UberMenu. There are just a few settings tweaks that need to be made: UberMenu Settings Menu Bar Alignment If you want the menu to be aligned to the right of your logo, set the menu bar alignment to “Right” Skin To mimic the original theme menu most closely, choose the Vanilla […]

Reset Kleo Love/Likes

By using the next SQL query you will be able to reset whole posts to 0 love/likes SELECT * FROM ‘wp_postmeta’ WHERE ‘meta_key’ = ‘_item_likes’ AND meta_value != 0; That’s all

Show Kleo Love/Likes Only for logged in Users

If you need to show KLEO likes/love only to logged in users you can do that by using this function function AllowKleoLikesToLoggedInUsers () { global $kleo_item_likes; if(!is_user_logged_in()) { remove_action(‘publish_post’, array($kleo_item_likes, ‘setup_likes’)); remove_action(‘kleo_post_footer’, array($kleo_item_likes, ‘show_likes’)); remove_action(‘kleo_show_love’, array($kleo_item_likes, ‘show_likes’)); remove_action(‘wp_ajax_item-likes’, array($kleo_item_likes, ‘ajax_callback’)); remove_action(‘wp_ajax_nopriv_item-likes’, array($kleo_item_likes, ‘ajax_callback’)); } } add_action(‘after_setup_theme’, ‘AllowKleoLikesToLoggedInUsers’, 99); The function will be added to wp-content/themes/kleo-child/functions.php

Add a custom color preset for Theme options Styling sections

Starting with KLEO 4.0 you can now define your own custom styling presets to apply to sections from Theme options – Styling. To add a custom color preset just add this code to your kleo-child/functions.php file and modify the values to match your needs: add_filter(‘section_color_presets’, ‘kleo_my_add_custom_color_preset’); function kleo_my_add_custom_color_preset( $presets ) { $presets[‘my-preset-slug’] = array( ‘alt’ => ‘My color preset name’, […]

Modify default image sizes from category pages

By default KLEO generates the images at the size of 460×270 for your archive pages like your main blog page or category page. To change the image dimensions you just need to have you child theme active and add this small snippet to kleo-child/functions.php   add_action( ‘after_setup_theme’, ‘kleo_custom_media_size’, 20 ); function kleo_custom_media_size() { global $kleo_config; $kleo_config[‘post_gallery_img_width’] = 260; //initial was […]