New Landing How can we help? Cardinal Change post content width

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Cardinal
  • #159566
    bssmithy
    Member
    Post count: 55

    I have the site set to 1170px wide, but the blog post content on single posts is only showing up at 730px wide. I’d actually like the blog post content on single posts to be at 940px wide, since I’ll be posting a lot of images on my blog post and that’s an ideal width for what I need.

    I’ve played around with the code for a long while and can’t figure it out. How can I change the content width to be 940px?

    Thanks.

    #159585
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    You’ll need to edit the single-post.php found in swift-framework/layout

    Find line 69:

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

    Change ‘col-sm-8 col-sm-offset-2’ to ‘col-sm-10 col-sm-offset-1’

    – Kyle

    #160042
    bssmithy
    Member
    Post count: 55

    Thanks, I found it. How might I add these files to the child theme to avoid them getting overwritten in an update? Can I just create a “swift-framework” folder in my child theme folder with a “layout” folder inside containing the .php files I’d like to manipulate? I’ve never had to add files that are so deep in the hierarchy to a child theme before, and I don’t want to break the site.

    Thanks for all the help, Kyle.

    #160093
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please add this code only at functions.php of child theme.

    add_filter( 'sf_post_content_wrap_class_nosidebar', 'sf_wrap_class_new' );
    function sf_wrap_class_new($class){
    $class ='col-sm-10 col-sm-offset-1';
    return class;
    }

    Thanks
    Mohammad

    #160446
    bssmithy
    Member
    Post count: 55

    I tried that and it broke the theme. I must be doing something wrong.

    #160465
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to put this code at end of functions.php file.

    <?php
    add_filter( 'sf_post_content_wrap_class_nosidebar', 'sf_wrap_class_new' );
    function sf_wrap_class_new($class){
    $class ='col-sm-10 col-sm-offset-1';
    return class;
    }
    ?>

    Thanks
    Mohammad

    #161644
    bssmithy
    Member
    Post count: 55

    That also broke the site.

    #161691
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to put this code at end of functions.php file.

    <?php
    add_filter( 'sf_post_content_wrap_class_nosidebar', 'sf_wrap_class_new' );
    function sf_wrap_class_new($class){
    $class ='col-sm-10 col-sm-offset-1';
    return $class;
    }
    ?>

    Thanks
    Mohammad

    #161717
    bssmithy
    Member
    Post count: 55

    Awesome, that worked. Is there similar code I could use to get the comments area to appear at that width as well?

    #161723
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please add this code:

    add_filter('sf_post_comments_wrap_class', 'sf_wrap_class_comment')
    
    function sf_wrap_class_comment($class){
    $class ='col-sm-10 col-sm-offset-1';
    return $class;
    }

    Thanks
    Mohammad

    #163544
    bssmithy
    Member
    Post count: 55
    This reply has been marked as private.
    #163579
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    This error related with wordpress. Its not theme issue.
    Thanks
    Mohammad

Viewing 12 posts - 1 through 12 (of 12 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