Case 1 – is_rtl()
is not working because it has been called directly. To use such contditional tags in WordPress, query should already be run. So such function should be used inside the function hooked to appropriate hook. Since it is called directly, its value will be always false.
See https://developer.wordpress.org/themes/basics/conditional-tags/#where-to-use-conditional-tags
Case 2 – It is working because you can using this tag inside the function hooked to admin_footer
. So, is_rtl()
will give you appropriate value.
So, if admin_footer
is not working for you then, you need to check which hook is appropriate for you and use is_rtl()
inside the function hooked properly.
Related Posts:
- Can I make plugins required?
- wp_enqueue_scripts not working in custom theme
- What is the correct way for a theme to support plugin UIs?
- Automatically install wordpress plugin at theme activation
- When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?
- Create WooCommerce Product Category Programmatically
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- WordPress tips for speed and performance [closed]
- How to access options of Redux framework in front end
- Update Multiple Post Meta for the Same Post In One call?
- Integrating plugins in themes
- login to wordpress with Get variables instead of Post
- How to load a new template page according to a particular URL?
- Should I use RIPS tool to test my themes and plugins?
- Translate third party plugin and save translation files in custom theme
- Code in theme functions.php faster than with a plugin?
- How do I future proof my older WordPress theme?
- register_theme_directory somehow “fails” when folder is outside of WP-Folder
- Display future posts?
- Having separate plugins and themes folder for multi-site setup
- gallery option is not available in media upload box in costum theme option page
- Why are some of my thumbnails not being generated?
- How to retrieve custom meta term of category taxonomy from WP Rest API?
- How to use get_theme_mod in gutenberg editor wordpress?
- How to Display a Plugin function (content) on frontpage using index.php
- How to make a slideshow shortcode based on the WordPress gallery shortcode? [closed]
- All of my custom posttypes are 404’ing
- Classified ad website : which solutions to use? [closed]
- What are the specifics of WordPress development I need to know? [closed]
- Finding the URL to be used to check if plugin is installed with a theme
- Js file is not adding using this code in functions.php
- Jquery NoConflict Problem
- Redirect to another page using contact form 7? [closed]
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- multiple language website navigation menu suggestion
- Add SideBar/Widgets Just Below the Post
- Add filter on html tags,attributes on specific function in wordpress
- plugins not working in custom theme
- Release the plugin in the WordPress repository where redux is used
- How can I support plugins in a custom theme?
- How to use the CSS of the WordPress core in the development of my administration page?
- Redeclare function after plugin activation
- Woocommerce singe product custom gallery output works just on the first slide
- Remove Pagination for Product Category Pages WooCommerce
- How can I use my custom wordpress theme on two websites? [closed]
- Widget for specific category
- why need theme,if page builder is there in wordpress [closed]
- Visual Composer: Where do I find the source code of a custom element?
- How to customize this theme? [closed]
- WordPress API functions not working at AJAX functions.php call
- Don’t load the theme for a page FROM a plugin EDITED
- Hardcode a form in Contact Form 7 [closed]
- how to design change in woocommerce cart page and all other page also by theme? [closed]
- How do you create a re-useable HTML fragment in wordpress
- WordPress plugin with its own “site”/theme
- Override methods in Yoast SEO breadcrumb class
- Identify current wordpress theme
- Update WordPress Theme System
- Removing the custom_image_header from wp_head
- Code for unique user visit count on every page WordPress
- Xamp installed local wordpress not allowing to publish or install plugin
- Elementor Sidebar not loading when PRO elements plugin is active
- Widgets are not displaying in the admin panel
- How would I get the new plugin version on this function?
- Newbie problem with adding include wp_footer
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- woocommerce: Customize email with item total count
- Child theme modifications not showing up
- Conditional Homepage for logged in user
- How can I see $post object in frontend from functions.php?
- How to get checkbox by default true in metabox?
- when i activate my WordPress plugin cannot see customizer options or preview
- Showing different js file for different theme in wordpress customizer api
- When the user entered an unauthorized url redirect to login page
- How to wrap image tag into div for post only?
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- Help Code Review – I need to write on .htaccess file from theme’s function.php
- Where do the section input fields values are stored in database
- How to display the Facebook like count in WordPress theme [closed]
- How to increase script execution time at my server
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Convert HTML5/CSS3 site to WordPress Theme (need a lot of plugins) or just use the API?
- twitter widget loads properly in all themes except my own theme?
- Plugin’s required JS not being inserted in my theme
- Directory structure for plugin changes
- How to show post attachment image
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- What is the Object for WP_Error Class?
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Disqus plugin outputs script as literal text
- Replace all media (images)
- How to generate a responsive output from plugin?
- How to work email subscribe in WordPress?
- Apostrophes replaced by '
- Editing a theme
- Ajax button “Load more” is not loading correct language version posts for logged out users
- How to code a wordpress page properly? Dashboard or unique Theme files or alternative?
- how to make wordpress remember my choice
- Meta box not displaying on the plugin page
- Getting error when accessing Customizer Page