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
- Where to put my code: plugin or functions.php?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to get the path to the current theme?
- Why does WordPress use outdated jQuery v1.12.4?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Widget development – Drop down options won’t save
- Is There A Hook To Process The Content Of The Text Widget?
- Check for featured image in WP_Query
- Update exisiting site to 3.5 release candidate
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- Having Problem On Getting WP Post Gallery Images URL
- Script to remove all inactive widgets?
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- How to bundle a plugin with a theme, or vice versa
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Using $wpdb object in a widget
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Tips for targeting widget dragable for WP Pointer on widgets.php page
- Best choice of options/settings framework for plugin/theme development
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Change template dynamically
- Display content from custom post without modifying the single template
- Can I change header.php of current theme through a plugin function?
- Tried in different ways but sidebar not working?
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- How to hook a custom user function to a wordpress core ajax action?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- WP Gutenberg Blocks – How to limit first/root blocks
- How developed with version control word press site on shared host? [closed]
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- PowerPress mobile media player
- Input in plugin widget does not allow spaces
- When is the proper time to minify css and js with git workflow?
- Get draggable widgets on Edit Post page
- How to Get Current Custom Post Type Associated Taxonomy Term
- Widget options are not updated
- Plugin templates vs Parent Theme
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- 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
- 400 Bad Request, in wordpress theme development, wp_ajax
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Are there any official or unofficial guidelines for the styling of a widget?
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Full documentation about $args for register_rest_route?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to show multiple instances of the WP125 Widget?
- How can the_excerpt (or equivalent) be called on a category description?
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to access index file in Block Themes?
- WordPress Favicon not Working For Images/Videos/PDFs
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Redirection from a specific page for users logged in but not with membership
- 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
- Load script on frontend from widget plugin
- Can’t get wpColorPicker to work in a widget
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Custom premium registration form and profile page for a WordPress Web Application
- How to destroy or dispose wordpress uploder/manager?
- Widget won’t be activated
- Font Awesome stopped showing icons, shows &# text instead [closed]
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- How can I add recent posts to menu like mashable
- Generate activation url
- Display Data’s metabox in page
- Ajax functions – no access to wp-admin.php only online
- How do I create Widget within plugin that uses its own class?
- Saving multiple fields as array
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Gutenberg text field validation
- how to catch a data from a array in WordPress
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- Is there any other ways to replicating changes on live from staging without pushing from git
- Hook a search form anywhere on the site, using a custom plugin
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php