New Landing How can we help? Cardinal Upgrade Advice for New Cardinal Version

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Cardinal
  • #173385
    ovollc
    Member
    Post count: 48

    I’d like to upgrade to the new version of Cardinal is it fixed a few issues we are currently having.

    All of our CSS updates have been made in the CSS Customizer in the theme settings, so we are good there.

    We have made updates to the functions.php and single-post.php, within the Swift Framework.

    The functions additions, look like this:

    
        /* Hildebrant Added to support JetPack Gallery Width
        ================================================== */
    
        add_action( 'admin_init', 'sf_admin_scripts' );
    
        function bk_set_jetpack_width() {
        global $sf_sidebar_config;
        if (($sidebar_config == "left-sidebar") || ($sidebar_config == "right-sidebar")) {
    
            // content width for one sidebar
            $content_width = 922;
            return $content_width;
    
        } else if ($sidebar_config == "both-sidebars") {
    
            // content width for both sidebars
            $content_width = 922;
            return $content_width;
    
        } else {
    
            // content width for no sidebars
            $content_width = 922;
            return $content_width;
    
        }
    }
    add_filter('jetpack_content_width', 'bk_set_jetpack_width');
    
    /* Added to address WP-added margin in captions on images
    ================================================== */
    
    add_shortcode('wp_caption', 'fixed_img_caption_shortcode');
    add_shortcode('caption', 'fixed_img_caption_shortcode');
    function fixed_img_caption_shortcode($attr, $content = null) {
    	// New-style shortcode with the caption inside the shortcode with the link and image tags.
    	if ( ! isset( $attr['caption'] ) ) {
    		if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
    			$content = $matches[1];
    			$attr['caption'] = trim( $matches[2] );
    		}
    	}
    
    	// Allow plugins/themes to override the default caption template.
    	$output = apply_filters('img_caption_shortcode', '', $attr, $content);
    	if ( $output != '' )
    		return $output;
    
    	extract(shortcode_atts(array(
    		'id'	=> '',
    		'align'	=> 'alignnone',
    		'width'	=> '',
    		'caption' => ''
    	), $attr));
    
    	if ( 1 > (int) $width || empty($caption) )
    		return $content;
    
    	if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
    
    	return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . $width . 'px">'
    	. do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>';
    }
    

    The single-post.php changes look like this:
    Changed:

    
    $content_wrap_class = apply_filters( 'sf_post_content_wrap_class_nosidebar', 'col-sm-8 col-sm-offset-2' );
    }
    

    to this:

    
    $content_wrap_class = apply_filters( 'sf_post_content_wrap_class_nosidebar', 'col-sm-10 col-sm-offset-1' );
    }
    

    ===

    That said, what’s the best way to go about this update, considering that you have changed the way your Framework works with the plugin approach.

    Should I make these changes to the same files in the new theme? And if so, has single-post.php moved to a different location?

    I assume I cannot just drop in the old versions of these modified files from the theme version previous?

    Any help you can provide would be greatly appreciated.

    #173430
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    The single-post.php is still part of the theme files, so in that case having your modified files inside the child theme it will be alright.

    Copy the latest single-post.php replicate your change and move it to the child theme.

    The functions additions you should move them to the functions.php of the child theme.

    Let us know if you made it.

    -Rui

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register