Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • in reply to: Customize Call to Action Heart #30031
     4bservices
    Participant

    @Catalin Hello. So I know that the code works as when I add the code the hearts go away and where I want it replaced it is showing a dashboard instead. The issue is however that when I add the above code to the child functions then the wp-admin area no longer works due to errors. What is wrong with our functions.php code? Why when we try to remove/replace the hearts does it break the site?

    COPY CODE
    
    function kleo_copyright_text()
    {
      echo '<p>'. __("Copyright", 'kleo_framework').' © '.date("Y").' '. get_bloginfo('name').'. <br class="hide-for-large show-for-small"/>'. get_bloginfo( 'description' ).'   <a href="http://jeepedin.com/tos/">TOS</a>  - <a href="http://jeepedin.com/privacy/">Privacy</a><br/><font size="1.3">JeepedIn is not in any way associated with Jeep or the Chrysler Corporation. <br/>Jeep, Wrangler, Cherokee and Grand Cherokee are copyrighted and trademarked to the Jeep/Chrysler Corporation.</font></p>';        
    }
    
    /* These restrictions will appear to be configured in Sweetdate - Memberships */
    
    add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks');
    
    function kleo_my_levels_checkmarks($settings) {
     
        $settings = array (
    		//NEW RESTRICTION MESSAGES page with name: message
            array(
                'title' => __('Access exclusive forums','kleo_framework'),
                'front' => __('Access exclusive forums','kleo_framework'),
                'name' => 'message'
            ),
    		//NEW RESTRICTION SHOP page with name: shop
            array(
                'title' => __('Eligible for special giveaways','kleo_framework'),
                'front' => __('Eligible for special giveaways','kleo_framework'),
                'name' => 'shop'
            ),
    //NEW RESTRICTION MESSAGES page with name: credits
            array(
                'title' => __('Credits to Place Classified Ads','kleo_framework'),
                'front' => __('Credits to Place Classified Ads','kleo_framework'),
                'name' => 'credits'
            ),
            array(
                'title' => __('Restrict members directory','kleo_framework'),
                'front' => __('View members directory','kleo_framework'),
                'name' => 'members_dir'
            ),
            array(
                'title' => __('Restrict viewing other profiles','kleo_framework'),
                'front' => __('View members profile','kleo_framework'),
                'name' => 'view_profiles'
            ),
            array(
                'title' => __('Restrict access to groups directory','kleo_framework'),
                'front' => __('Access group directory','kleo_framework'),
                'name' => 'groups_dir'
            ),
            array(
                'title' => __('Restrict access to single group page','kleo_framework'),
                'front' => __('Access to groups','kleo_framework'),
                'name' => 'view_groups'
            ),
            array(
                'title' => __('Restrict users from viewing site activity','kleo_framework'),
                'front' => __('View site activity','kleo_framework'),
                'name' => 'show_activity'
            ),
            array(
                'title' => __('Restrict users from sending private messages','kleo_framework'),
                'front' => __('Send Private messages','kleo_framework'),
                'name' => 'pm'
            ),
            array(
                'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'),
                'front' => __('Add media to your profile','kleo_framework'),
                'name' => 'add_media'
            )
        );
        return $settings;
    }
    
    // restrict profile area - Messages page
    //add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict1');
    
    function kleo_my_custom_restrict1()
    {
    	//full current url
    	$actual_link = kleo_full_url();
    	//our request uri
    	$uri = str_replace(untrailingslashit(home_url()),"",$actual_link);
    
    	//restrict messaging page url
    	if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri))
    	{
    		
    		$my_restrictions =  array('message' => array(
    				//2 - restrict certain levels. 0 -restrict none; 1 - restrict all
    				'type' => 2,
    				//levels that you apply the restrictions to
    				'levels' => array(2,-1),
    				//'not_member' => 1, //restrict users without a membership level
    				//'guest' => 1 // restrict not logged in users
    			)
    		);
    		//We use the name "message" from the new restriction added above
    		kleo_check_access('message',$my_restrictions);
    	}
    }
    
    //Restrict Shop page
    //add_filter('kleo_pmpro_match_rules', 'kleo_my_custom_restrict2');
    
    function kleo_my_custom_restrict2($restrictions) {
    	//regular expression for shop page
    	$restrictions["/^\/shop\/?$/"] = array('name' => 'shop');
    	return $restrictions;
    }
    function my_reg_page( $register_url ) {
        return pmpro_url("levels");
      }
     
    add_filter( 'register_url','my_reg_page',9999);
     
    add_filter( 'bp_get_signup_page','my_reg_page',9999);
    
    add_action('after_setup_theme','kleo_my_hearts_actions');
     
    function kleo_my_hearts_actions()
    {
       /* disable matching on member profile */
        remove_action('kleo_bp_before_profile_name', 'kleo_bp_compatibility_match');      
     
        /* Replace the heart over images */
        add_filter('kleo_img_rounded_icon', 'my_custom_icon');
     
        /* Replace the heart from register modal */
        add_filter('kleo_register_button_icon', 'my_custom_icon_register');
     
        /* Replace the heart from About us widget */
        add_filter('kleo_widget_aboutus_icon', 'my_custom_icon_about_widget');
    }
     
    /* Replace the heart with a camera icon function */
    function my_custom_icon () {
        return 'dashboard';
    }
     
    /* Replace the heart from register modal with a user icon function */
    function my_custom_icon_register () {
        return 'dashboard';
    }
    /* Replace the heart from about us widget with a user icon function */
    function my_custom_icon_about_widget () {
        return 'dashboard';
    }
    in reply to: Customize Call to Action Heart #26483
     4bservices
    Participant

    child functions.php

    COPY CODE
                                    <?php
    /**
     * @package WordPress
     * @subpackage Sweetdate
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Sweetdate 1.0
     */
    
    /**
     * Sweetdate Child Theme Functions
     * Add extra code or replace existing functions
    */ 
    
    function kleo_copyright_text()
    {
      echo '<p>'. __("Copyright", 'kleo_framework').' © '.date("Y").' '. get_bloginfo('name').'. <br class="hide-for-large show-for-small"/>'. get_bloginfo( 'description' ).'   <a href="http://jeepedin.com/tos/">TOS</a>  - <a href="http://jeepedin.com/privacy/">Privacy</a><br/><font size="1.3">JeepedIn is not in any way associated with Jeep or the Chrysler Corporation. <br/>Jeep, Wrangler, Cherokee and Grand Cherokee are copyrighted and trademarked to the Jeep/Chrysler Corporation.</font></p>';        
    }
    
    /* These restrictions will appear to be configured in Sweetdate - Memberships */
    
    add_filter('kleo_pmpro_level_restrictions', 'kleo_my_levels_checkmarks');
    
    function kleo_my_levels_checkmarks($settings) {
     
        $settings = array (
    		//NEW RESTRICTION MESSAGES page with name: message
            array(
                'title' => __('Access exclusive forums','kleo_framework'),
                'front' => __('Access exclusive forums','kleo_framework'),
                'name' => 'message'
            ),
    		//NEW RESTRICTION SHOP page with name: shop
            array(
                'title' => __('Eligible for special giveaways','kleo_framework'),
                'front' => __('Eligible for special giveaways','kleo_framework'),
                'name' => 'shop'
            ),
    //NEW RESTRICTION MESSAGES page with name: credits
            array(
                'title' => __('Credits to Place Classified Ads','kleo_framework'),
                'front' => __('Credits to Place Classified Ads','kleo_framework'),
                'name' => 'credits'
            ),
            array(
                'title' => __('Restrict members directory','kleo_framework'),
                'front' => __('View members directory','kleo_framework'),
                'name' => 'members_dir'
            ),
            array(
                'title' => __('Restrict viewing other profiles','kleo_framework'),
                'front' => __('View members profile','kleo_framework'),
                'name' => 'view_profiles'
            ),
            array(
                'title' => __('Restrict access to groups directory','kleo_framework'),
                'front' => __('Access group directory','kleo_framework'),
                'name' => 'groups_dir'
            ),
            array(
                'title' => __('Restrict access to single group page','kleo_framework'),
                'front' => __('Access to groups','kleo_framework'),
                'name' => 'view_groups'
            ),
            array(
                'title' => __('Restrict users from viewing site activity','kleo_framework'),
                'front' => __('View site activity','kleo_framework'),
                'name' => 'show_activity'
            ),
            array(
                'title' => __('Restrict users from sending private messages','kleo_framework'),
                'front' => __('Send Private messages','kleo_framework'),
                'name' => 'pm'
            ),
            array(
                'title' => __('Restrict users from adding media to their profile using rtMedia or bpAlbum','kleo_framework'),
                'front' => __('Add media to your profile','kleo_framework'),
                'name' => 'add_media'
            )
        );
        return $settings;
    }
    
    // restrict profile area - Messages page
    //add_action('kleo_pmro_extra_restriction_before_my_profile','kleo_my_custom_restrict1');
    
    function kleo_my_custom_restrict1()
    {
    	//full current url
    	$actual_link = kleo_full_url();
    	//our request uri
    	$uri = str_replace(untrailingslashit(home_url()),"",$actual_link);
    
    	//restrict messaging page url
    	if(preg_match("/^\/".bp_get_members_root_slug()."\/". bp_get_loggedin_user_username()."\/messages\/?/", $uri))
    	{
    		
    		$my_restrictions =  array('message' => array(
    				//2 - restrict certain levels. 0 -restrict none; 1 - restrict all
    				'type' => 2,
    				//levels that you apply the restrictions to
    				'levels' => array(2,-1),
    				//'not_member' => 1, //restrict users without a membership level
    				//'guest' => 1 // restrict not logged in users
    			)
    		);
    		//We use the name "message" from the new restriction added above
    		kleo_check_access('message',$my_restrictions);
    	}
    }
    
    //Restrict Shop page
    //add_filter('kleo_pmpro_match_rules', 'kleo_my_custom_restrict2');
    
    function kleo_my_custom_restrict2($restrictions) {
    	//regular expression for shop page
    	$restrictions["/^\/shop\/?$/"] = array('name' => 'shop');
    	return $restrictions;
    }
    function my_reg_page( $register_url ) {
        return pmpro_url("levels");
      }
     
    add_filter( 'register_url','my_reg_page',9999);
     
    add_filter( 'bp_get_signup_page','my_reg_page',9999);
    ?>
    
                                

    I am now getting tons and tons of errors referencing this page. Do you see anything that isn’t right? I don’t see anything that stands out. Things saying that the header is already called elsewhere and just tons of errors. Also when people click the login button and enter their information it then loads jeepedin.com/wp-admin as a blank white page. I thought it went to the profile?

    in reply to: Customize Call to Action Heart #26481
     4bservices
    Participant

    I removed the following from the functions.php file in the child theme.

    COPY CODE
    add_action(‘after_setup_theme’,’kleo_my_hearts_actions’);
     
    function kleo_my_hearts_actions()
    {
    /* Replace the heart over images */
    add_filter(‘kleo_img_rounded_icon’, ‘my_custom_icon’);
     
    /* Replace the heart from register modal */
    add_filter(‘kleo_register_button_icon’, ‘my_custom_icon_register’);
     
    /* Replace the heart from About us widget */
    add_filter(‘kleo_widget_aboutus_icon’, ‘my_custom_icon_about_widget’);
    }
     
    /* Replace the heart with a camera icon function */
    function my_custom_icon () {
    return ‘tachometer’;
    }
     
    /* Replace the heart from register modal with a user icon function */
    function my_custom_icon_register () {
    return ‘tachometer’;
    }
    /* Replace the heart from about us widget with a user icon function */
    function my_custom_icon_about_widget () {
    return ‘tachometer’;
    }

    However things are still not working. It’s all sorts of a mess. So far it’s been 12 hours I’ve been combing through all the pages and all the errors. Oh and the darn hearts are back too…. of course since I removed the code 🙁

Viewing 3 posts - 1 through 3 (of 3 total)

Log in with your credentials

Forgot your details?