Most likely you are trying to put the shortcode into a widget area that is in the page header. It seems that shortcodes in text widgets are activated without further configuration, however if you instead use a custom_HTML widget, then this code is required:
add_filter('widget_text', 'do_shortcode');
@rossmitchell
thanks for your reply, but please tell me for more if i will paste our full code here. because we also mention ” add_filter(‘widget_text’, ‘do_shortcode’); ” but not useful in our plugin. please help us live(if possible). i am just starting in wordpress, when i learn these points then i hope i will not ask these question on forum.
Please do not post large amounts of code here. Use something like pastebin.com and just provide a link here. If you desire live support, I suggest you use IRC chat at #wordpress channel.
Injecting content in a page’s header is largely theme dependent. Most themes use wp_nav_menu(), so you could use one of the hooks available for that function to add your content before or after the menu HTML.
Dear @bcworkz,
Please check this link ” https://pastebin.com/C7h4t8F0 ” i have mentioned our code for that so please correct me, and also possible then please inform us how to upload our plugin on wordpress from linux. i have found lot of option but every video and solution for window computer not for linux.
You said “please inform us how to upload our plugin on wordpress”
Are you asking how to place your plugin in the wordpress.org plugin repository? Has your plugin been approved by the plugin review team and have you been assigned a folder in the plugins subversion repository? Submitting your plugin for review would be the first step.
If you have been assigned a folder in the subversion repository, you need a subversion client. There are several available for Linux. Using the client, copy your files into the appropriate sub-folders. The specifics of doing so depends on the client you chose.
@bcworkz
our plugin has approved by wordpress. but as per wordpress team say upload via SVN, but we are using linux and i dont know the process of svn in linux. So please provide any other alternate then we will upload our plugin on wordpress. we have many plugins for wordpress platform but firstly we want to upload our first plugin on wordpress market. But SVN is big problem for that. So please help us.
As I said, you need a subversion client. There are several available for Linux. Using the client, copy your files into the appropriate sub-folders. The specifics of doing so depends on the client you chose.
For example, maybe you would like RabbitVCS. I’ve no personal experience with it, but it sounds a lot like TortoiseSVN, whose use is documented. Another possible client for Linux is RapidSVN.
Finally, the WP documentation often includes examples using the Linux command line tool svn. If you have Apache2 installed, this should be part of your distro already. Try $ svn help in your terminal to confirm. If Apache2 is not installed already, it can be added. For example $ apt install subversion apache2 libapache2-svn