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 display widget by id
- Change Password Hint
- Dynamic URL to reference custom PHP files
- WordPress Shortcode and Dynamic CSS
- Second select list values are not saved after clicking update
- Use wc_enqueue_js only on specific pages – nested add_action
- Theme url in all plugin pages
- Add before_content and after_content to register_sidebar
- How can i display post loop in table format?
- An unwanted inline style is added to my body tag
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Selectbox in admin panel function linking to CSS
- Using if/else statements with output from theme options
- what is the best practice to add new field to an api route
- Use custom post type for a store locator
- WP CRON duplicate wp_insert_post with has < and > tag
- custom css for admin only
- responsive.css in the WordPress should be prioritized
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- Odd / Even posts add class minus first post
- Asynchronous multiple requests 401 Unauthorized
- Using data sent via AJAX in multiple functions on a WP plugin
- WordPress archive page showing 404 Error [duplicate]
- What does -> mean in WordPress?
- Removing WordPress Footer -without access to PHP code?
- Change product_base programmatically
- How to add the sidebar to all the pages except the home page? [closed]
- Plugin development and composer
- CSS change in woo commerce Place Order Text [closed]
- Post repeated when opening in overlay, how do I solve this? [closed]
- Set default Database Storage Engine when creating tables with plugins?
- Correctly Using checked function of WordPress
- custom post type with role Vendor
- Execute Jquery when a specific page in my plugin is loading
- How to make changes to style.php [closed]
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- Create Columns with Custom Walker and CSS Classes
- How do you create a custom category widget that you can style?
- WordPress can’t use ZipArchive
- Why would the child theme load in the Customize preview, but not on the site itself?
- echo cutom css code to WordPress page template file ? is this safe?
- Only the first image uploads
- WordPress loading progess – wp-blog-header.php
- Illegal string offset checkbox
- Custom plugin: how do I call a PHP file if settings option is set to true?
- Inserting a class on before_widget if checkbox is checked
- Trying to use a variable to set image width
- Trying to generate a CSS file in wordpress uploads folder
- WP Website is shown in HTML
- wp_update_post gives 500 internal error
- How to identify which php file a plugin is using on page load?
- register_setting not save checkbox
- I got big white screen when i attach main style sheet of Html in functions.php
- Add a default style if no Featured image is selected
- How does one make a URL return dynamic JSON with custom Content Type?
- How to make a “page-option” in WordPress
- Styling a specific post after hovering over it
- missing admin bar and widget in a template
- add menu page in loop menu order
- CSS loading as empty file in Custom Theme
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- My own theme’s custom widget areas are not working
- How limit the width of a fixed menu-bar on scroll?
- Where to find the html for WordPress site? [closed]
- How to remove image on single product and get product to span page?
- Show contact 7 form in popup
- My custom widget won’t stay in the widget area after I refresh the widget page
- Can’t remove menu items added by plugin
- Issues separating my Plugin pages into different files
- How to get shared CSS body class between translated WPML pages [closed]
- How to customize posts in WordPress by using HTML and CSS?
- How to hide Ads From Certain Categories?
- Header location [closed]
- Blog listing not showing dates for every post and arrow missing off image
- Displaying custom meta box value in a custom post page
- Create a custom plugin with dynamic child pages listing database records
- Styling best practices for single pages/templates