• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to add a video widget in News-pro theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How to add a video widget in News-pro theme

This topic is: not resolved

Tagged: CSS grid, video widget

  • This topic has 1 reply, 2 voices, and was last updated 3 years, 5 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 22, 2019 at 3:03 pm #493114
    chikamiku
    Participant

    I am using News-pro theme to develop a news website. I wanted to add a video widget right after Home-Bottom widget. This widget could display 5 or 6 videos in a horizontal row in scrolling format. Is there any way to do that, please?

    Thanks and regards

    https://ummahaffairs.com/
    October 18, 2019 at 1:05 am #494108
    Brad Dalton
    Participant

    1. Add a new widget area using PHP code

    genesis_register_sidebar( array(
        'id' => 'css-grid-widget',
        'name' => __( 'Grid Widget', 'genesis' ),
    ) );
    
    add_action( 'genesis_after_header', 'front_page_grid_widget' );
    function front_page_grid_widget() {
    
        genesis_widget_area( 'css-grid-widget', array(
            'before' => '<div class="grid-container">',
            'after'  => '</div>',
        ) );
        
    }
    

    2. And the use CSS to display each widget in columns

    .grid-container .widget {
            display: inline-block;
            width: 23.5%;
            margin: 0.5%;
    }
    
    @media only screen and (max-width: 960px) {
    
        .grid-container .widget {
            display: block;
            width: 100%;
        }
    
    }
    
    @supports (display: grid) {
    
        .grid-container {
            margin: 50px;
            display: -ms-grid;        
            display: grid;
            -ms-grid-columns: 1fr 1fr 1fr 1fr;        
            grid-template-columns: 1fr 1fr 1fr 1fr;
            grid-template-rows: auto;
            grid-gap: 20px;
        }
    
    }
    
    @supports (display: grid) {
    @media only screen and (max-width: 1100px) {
    
       .grid-container {
            -ms-grid-columns: 1fr 1fr;          
            grid-template-columns: 1fr 1fr;
        }
        
      }
    
    }
    
    @supports (display: grid) {
    @media only screen and (max-width: 680px) {
    
        .grid-container {
            -ms-grid-columns: 1fr 1fr;          
            grid-template-columns: 1fr; 
        }
       
      }
    
    }
    

    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble