try to make a simpler code: change
$side_bar= "'$city-Right'";
to
$side_bar= $city . '-Right';
you have extra '
in $side_bar
, the way you’ve done would give you 'Madurai-Right'
but you need Madurai-Right
, this way
dynamic_sidebar($side_bar)
would be like writing
dynamic_sidebar("'Madurai-Right'")
while you only need
dynamic_sidebar("Madurai-Right")
besides, always avoid variable substitution, concatenation is always more secure.
Related Posts:
- Can I individually style items in the backend widget list?
- Customizer: widget-synced triggers twice
- How to limit number of number of categories displayed by categories widget
- How to embed or integrated a custom WordPress Widget into the theme?
- Dynamic sidebar areas not working on the Theme Customizer
- grouping my widgets wordpress
- CSS not affecting widget output
- How to create a backend for a custom theme?
- Using a multiple element in widget form
- wp_nonce_field displaying twice
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- Problem with saving checkbox values with WordPress Widget API
- Is it necessary to do validation again when retrieving data from database?
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- WP Plugin Running before jQuery
- Template directory in plugin
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- 400 Bad Request, in wordpress theme development, wp_ajax
- Add child pages to submenu automatically
- Why in this archive page that call query_posts() function show only the last 10 posts?
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Are there any official or unofficial guidelines for the styling of a widget?
- Why enqueue styles on hook?
- Create Widget or Enable Shortcodes in Sidebar
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- Minimum Widget Width for Plugin Development
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How to create a wordpress widget that dynamically changes according to the page
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Does WordPress default CSS have Grids?
- Using HTML links within translatable string
- How to resize WordPress images on upload to specific height and width without cropping it
- Create fixed static pages
- How to get terms for taxonomy
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress Page Reload Takes forever during theme development
- Can / should a widget plugin define its own Widget Area?
- Adjust query on single
- How to exclude categories from get_categories() select list inside a widget admin panel
- Setting a post’s category
- Widget internal hooks and functions
- rewrite_rules problem
- Using password protection to load different page elements?
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- How to show multiple instances of the WP125 Widget?
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Why does website stretch and white space on load? [duplicate]
- Console errors in 6.0-RC1 Widget screen
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- Why my theme’s css not working on another site
- How to access index file in Block Themes?
- Widgets are not displaying in the admin panel
- How to show comments from different Plugins to same post type?
- Pass custom props to
- Error code when migrate
- Include external po file for 3th party plugin to theme
- WordPress Favicon not Working For Images/Videos/PDFs
- How to make premium plugin? I want to limit it until verification
- How does update method in Widget class saves $instance array from Select tag?
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Override category archive page title (not the head title)
- How do I add filter with woocommerce categories?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section
- Metabox types list
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Quick Draft widget (dashboard.php) using custom post_type
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Uncaught Error: Call to undefined function wp_get_current_user() in