Googled some more and found out that closing php tags and writing html as it is a better practice as compared to writing html inside. Made the following changes to the code shared above:
$space=200px;
?>
<div style="margin-bottom:<?php echo $space; ?>" >
<?php
//rest of the code
?>
</div>
<?php
//rest of the code
Space between widgets added!
Related Posts:
- How to display a value from a radio button in the options menu in wordpress
- Style every second widget?
- Missing sidebar parameter “fix” – before_content
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- How to make my custom widget appear within WordPress widgets? Plugin development
- Adding widgets to my plugin page instead of WordPress dashboard
- Hook called before text widget save
- wordpress admin plugin menu custom css
- How to Change CSS Colors from Custom Plugin Settings Page
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- How to Remove Theme Style CSS inside Custom Plugin?
- Drop down question
- dashboard widget form not submit mails
- Add widget area from visual editor
- register dependency css and js inside a plugin class
- Priority call methods – PHPMailer->addAddress(NULL)
- PHP: Why does my code work in index.php but not a widget?
- Widget edit and add in any page
- how to check elementor is widget is active or loaded
- How to group 2 radio buttons in a widget?
- Add before_content and after_content to register_sidebar
- Making Quote Plugin more efficient
- How to access function from outside of a class within this class in WP plugin?
- Hiding WordPress Plugin Source Code
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- How can i display post loop in table format?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- Page Reloads Before AJAX Request Finishes
- I can’t get my custom widget area to show on my WordPress site
- How to run PHP code in Text Widget with no plugin in WP 4.4
- action hook wp_head higher priority as all other plugins/hooks
- wp nav menu: add attributes to menu items [duplicate]
- WordPress widget/sidebar dividers?
- WordPress override bloginfo variable
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- PHP can I add line numbers to file_get_contents()
- Put CSS inside a PHP file and include it the right way
- Add htaccess rules with insert_with_markers at beginning of htaccess
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- How to call function at the bottom of post using plugin?
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- An unwanted inline style is added to my body tag
- custom widget on the footer
- Insert array data on plugin activation
- Will simple function names in a class structure conflict with other plugins?
- Do my defines need to be unique?
- Displaying theme options in css
- WordPress php filter admin_body_class not working
- Show post in slider
- Problem adding class to body_class
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins
- Add a custom stylesheet for BlackBerry
- How can I hide Home in my menu in a specific page?
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- How Display Posts on category
- WP add_action factory
- wp_loaded hook block script enquequing
- WP nonce invalid
- woocommerce subscriptions – get expiration date [closed]
- Same log message keeps on printing to debug.log file thousand of times
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- How to add just one specific page to widget without plugin?
- Slider loading issue
- Adding Default Settings to Theme My Login plugin
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Swapping wp_dropdown_categories function with wp_category_checklist
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Accessing the database from a plugin outside of action hooks
- Parent theme CSS overriding child CSS rules
- Adding subdomain to home_url for “add_menu_page”
- How to put a variable in a instance in the widget
- how to remove metadata from the posts of my blog?
- How to output widget
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- How to style options page in dashboard?
- Theme Options Page – User Updates Logo
- Extending the WP_Widget_Text class
- How to use my style.css file outside of wordpress subdomain?
- How to access global variable $menu inside a class function
- Dynamic Stylesheet loads but doesn’t finish
- How to add date to navigation bar
- Dynamic Sidebars & Echo
- Selectbox in admin panel function linking to CSS
- Can I install/embed WordPress on a ‘single page’?
- Using if/else statements with output from theme options
- Is there CSS to expand the gallery limit on Index Pages?