Viewing 6 replies - 1 through 6 (of 6 total)
  • johnhshepard

    (@johnhshepard)

    Hi Maria,

    There is a bug in this plugin that causes the problem you’re having. If you’re comfortable editing the source code of the plugin, I can send you the appropriate code to solve your issue (and tell you where to add it).

    Let me know if you’d like the code or if you’d prefer to find a different plugin.

    –John

    Thread Starter elevatingyourbusiness

    (@elevatingyourbusiness)

    What file needs fixing? Then I can let you know.

    I can code html. Know what CSS looks like 🙂

    johnhshepard

    (@johnhshepard)

    The file is called “add-to-content.php” and is located in wp-content -> plugins -> add-to-content.

    Thread Starter elevatingyourbusiness

    (@elevatingyourbusiness)

    Ya. send me the code. Just LMK where it goes on the page.

    Thank you.

    I do like the plug in 🙂

    johnhshepard

    (@johnhshepard)

    Scroll to the bottom of “add-to-content.php” and find the following block of code:

    function add_to_content001($content) {
    $options = get_option( 'atc_settings' );
    
    	if( ( 1 == ($options['option']['one']) ) && ( 1 == ($options['top']['check']) ) && is_single() ){
    		$content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
    	}
    
    if( ( 1 == ($options['option']['one']) ) && ( 1 == ($options['bottom']['check']) ) && is_single() ){
    		$content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
    	}
    
    	return $content;
    }
    add_filter('the_content', 'add_to_content001');
    
    function add_to_content002($content) {
    $options = get_option( 'atc_settings' );
    
    	if( ( 1 == ($options['option']['two']) ) && ( 1 == ($options['top']['check']) ) && is_page() ){
    		$content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
    	}
    
    if( ( 1 == ($options['option']['two']) ) && ( 1 == ($options['bottom']['check']) ) && is_page() ){
    		$content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
    	}
    
    	return $content;
    }
    add_filter('the_content', 'add_to_content002');
    
    function add_to_content003($content) {
    $options = get_option( 'atc_settings' );
    
    $multiCategories= $options['option']['three'];
    // move into usable array
    $multiCategoriesArray=explode(',',$multiCategories);
    
    if( in_category( $multiCategoriesArray ) && ( 1 == ($options['top']['check']) ) && is_single() && ( $options['option']['three'] != '')){
    		$content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
    	}
    
    if(  in_category( $multiCategoriesArray )  && ( 1 == ($options['bottom']['check']) ) && is_single() && ( $options['option']['three'] != '')){
    		$content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
    	}
    
    	return $content;
    }
    add_filter('the_content', 'add_to_content003');
    
    function add_to_content004($content) {
    $options = get_option( 'atc_settings' );
    
    if (!empty ($options['option']['four'] ))
    $multiCategoriesx= $options['option']['four'];
    // move into usable array
    $multiCategoriesArrayx=explode(',',$multiCategoriesx);
    
    if( ! in_category( $multiCategoriesArrayx ) && ( 1 == ($options['top']['check']) ) && is_single() && ( $options['option']['four'] != '')){
    		$content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
    	}
    
    if(  ! in_category( $multiCategoriesArrayx )  && ( 1 == ($options['bottom']['check']) ) && is_single() && ( $options['option']['four'] != '') ){
    		$content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
    	}
    
    	return $content;
    }
    add_filter('the_content', 'add_to_content004');

    And replace with the following:

    function add_to_content001($content) {
    
        $options = get_option( 'atc_settings' );
    
        if (is_page()) {
            if (1 == ($options['option']['two'])) {
                if ( 1 == ($options['top']['check']) ) {
                    $content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
                }
                if ( 1 == ($options['bottom']['check']) ) {
                    $content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
                }
            }
        } elseif (is_single()) {
            if (1 == ($options['option']['one'])) {
    
            //look at included and excluded Categories
    
                if (!empty($options['option']['three'])){
                    $multiCategoriesInclude= $options['option']['three'];
                    // move into usable array
                    $multiCategoriesIncludeArray=explode(',',$multiCategoriesInclude);
    
                    if (in_category($multiCategoriesIncludeArray)) {
                        if ( 1 == ($options['top']['check']) ){
                            $content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
                        }
                        if ( 1 == ($options['bottom']['check']) ){
                            $content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
                        }
                    }
                } elseif (!empty ($options['option']['four'] )){
                    $multiCategoriesExclude= $options['option']['four'];
                    // move into usable array
                    $multiCategoriesArrayExclude=explode(',',$multiCategoriesExclude);
    
                    if (!in_category($multiCategoriesArrayExclude)) {
                        if ( 1 == ($options['top']['check']) ){
                            $content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
                        }
                        if ( 1 == ($options['bottom']['check']) ){
                            $content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
                        }
                    }
                } else {
                    if ( 1 == ($options['top']['check']) ){
                        $content = '<div style="color:'.$options['top']['tc'].';background-color:'.$options['top']['bc'].';background-image: url('.$options['top']['upi'].');">'.$options['top']['text'].'</div>' . $content;
                    }
                    if ( 1 == ($options['bottom']['check']) ){
                        $content = $content . '<div style="color:'.$options['bottom']['tc'].';background-color:'.$options['bottom']['bc'].';background-image: url('.$options['bottom']['upi'].');">'.$options['bottom']['text'].'</div>';
                    }
                }
            }
        }
    return $content;
    }
    
    add_filter('the_content', 'add_to_content001');

    Let me know how that works for you. And be sure not to update the plugin because it will overwrite these changes.

    Thread Starter elevatingyourbusiness

    (@elevatingyourbusiness)

    That worked. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Doubling up’ is closed to new replies.