• The above is the website that i am working on. The widget title supposes to be at the top of the colmun of the widget area i dont know what i miss out and it forms one of the columns in the widget area. How do i resolve.
    Below is my css and the sidebar itself.

    .homecategory_1 > section {
    	display: grid;
    	grid-template-columns: 1fr 1fr 1fr;
    	grid-column-gap: 20px;
    	background: yellow
    }
    
    		register_sidebar(
    		array(
    			'name'          => __( 'Home Category 1', 'bobo'  ),
    			'id'            => 'homecategory_1',
    			'description'   => __( 'Add widgets here.', 'bobo'),
    			'before_widget' => '<section id="%1$s" class="widget %2$s">',
    			'after_widget'  => '</section>',
    			'before_title'  => '<div class="td-block-title-wrap"><h4 class="block-title td-block-title"><span>',
    			'after_title'   => '</span></h4></div>',
    		)
    	);
    • This topic was modified 4 years, 7 months ago by shaibustephen.
    • This topic was modified 4 years, 7 months ago by Steven Stern (sterndata). Reason: moved from requests/feedback to fixing, removed extra link

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    The title elements should not be part of the grid section, they should occur before the grid section. When it’s part of the grid it takes up one entire grid element.

    Thread Starter shaibustephen

    (@shaibustephen)

    So, in that case, look at the code, how should it be then? Let me have a clue as i am a novice in wordpress development

    Moderator bcworkz

    (@bcworkz)

    I’m afraid your concept is flawed. A sidebar can grid individual widgets, but it should not try to grid elements within a widget. Your sidebar should not attempt to influence the layout of elements within a widget. It cannot know what sort of structure is being output within a widget. If you want a widget to output a grid of posts, you need a widget that does that for itself. The sidebar should not be trying to do that.

    Why are you using a sidebar as the main content area anyway? The main content area should be composed of editor blocks, not widgets.

    Thread Starter shaibustephen

    (@shaibustephen)

    Ok. Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What is wrong with the css of my widget?’ is closed to new replies.