Forum Replies Created
-
AuthorPosts
-
June 11, 2021 at 11:14 pm in reply to: Can the state of the widget change when a logged in user opens the widget #9593
Aakash
KeymasterHi Usman,
Happy that you got a solution !
Thanks,
AakashAakash
KeymasterHi Jeff,
With “Visitor conditions” -> Custom function you can write your own logic to say on which condition the announcement should be shown. In your case you are always returning true. So the announcement will be shown always (after closing the alert box)
Ideally it is for users to write some complex logic to decide if the announcement has to be shown when the page is loaded like checking cookies more than what is provided etc
In your case I think you wanted to show the announcement upon clicking the page right ?
You can try below code.
1. Remove the custom function you have configured
2. Go to display -> display announcement -> schedule
3. For Schedule duration –> selecte a older duration like 2 months before (this is to keep the announcement hidden)Now paste this code.
function downloadclicked(){ var my_annoucement = document.getElementById('ancr-37').announcer; my_announcement.show(); // or .hide(); } document.addEventListener("click", downloadclicked);
Here, when the page is clicked, then announcement will be shown (via
.show()
). Every announcer bar has a property called.announcer
. In above example, we are getting that and then calling.show()
of that.Change
37
to the ID of the announcer.If you want to target *any* announcement. Then you can select the announcer element by class name. Then you need to do something like in this page and do the same like above inside a for loop.
Thanks,
AakashJune 7, 2021 at 10:19 pm in reply to: Can the state of the widget change when a logged in user opens the widget #9570Aakash
KeymasterHi Usman,
Please go to plugin editor, select ultimate floating widget, select includes -> display.php
At line no 120, paste the following code.
if( in_array( $id, array( '3', '4' ) ) ){ $title = is_user_logged_in() ? 'My title when user is logged in' : 'Not logged in'; }
Here ‘3’, ‘4’ are the ID of the widget box for which you need to change. Replace that with your ID, add or remove IDs as needed like in the example.
Replace the title also as needed. First one is title when user is logged in. Second is when not logged in.
When the plugin upgrades, this changes will go.
I’ll provide a WordPress hook in the next version so that you don’t need to change it directly in the code. For now please use this.Thanks
June 7, 2021 at 4:08 pm in reply to: Can the state of the widget change when a logged in user opens the widget #9566Aakash
KeymasterHi Usman,
I saw your website. Can yoh please confirm if you want to change “You need to login for Inquiry Cart” ?
If yes, then I can share code to change this after login.
Thanks
June 7, 2021 at 2:44 pm in reply to: Can the state of the widget change when a logged in user opens the widget #9564Aakash
KeymasterHi Usman,
Sorry for the delay. I missed to reply for your query.
UFW provides an “box” where you can place “regular widgets”
So widgets are common. It does not matter whether it is in sidebar or UFW.
Below are my suggestions:
1) Find if there are any plugin which allows to change widget title as you need
2) Find/write custom code to change the title of your widget. Follow this link for an idea – https://wordpress.stackexchange.com/a/290010/3914 Here they are changin the title of recent posts widget.
3) Raise a topic in above forum and get some help on how to change the title for whatever widget on any criteria as you need.If you are trying to change the title of the “widget box” itself then that comes under UFW.
But right now there is no option to change the “widget box” title dynamically. I can share some code if needed which you need to edit.Thanks,
AakashAakash
KeymasterMarking this as resolved.
Aakash
KeymasterMarking this as resolved.
Aakash
KeymasterMarking this as resolved.
June 4, 2021 at 11:39 pm in reply to: Use a shortcode in a template or reusable code and share #9541Aakash
KeymasterCheers !
Aakash
KeymasterHi Mathemetica,
I think a plugin called “shortcoder” is there just to solve issue like this, where users can create a shortcode for HTML/CSS/JS/Shortcode snippets.
It is one of my other plugin.
You can create a shortcode, with above sharing shortcode itself as a content and then use the “shortcoder” created shortcode to use in posts and pages.Thanks,
AakashAakash
KeymasterHi,
I was able to find the issue.It was an issue with Announcer, when the “admin bar” at the top was displayed.
I’ve fixed the issue on your website.I’ll soon publish the fix in the next release.For now I think everything should be fine on your end.
Thanks,
AakashJune 3, 2021 at 12:46 am in reply to: Use a shortcode in a template or reusable code and share #9532Aakash
KeymasterHi @Mathematica,
I saw the links you have shared.
It seems there is no other way other than the templates “not executing” the shortcode.
This is common to all shortcodes or other sharing plugin which provides shortcodes.
Since the shortcode is executed in the context of the template, the URL is incorrect.Can you please check with yout theme developer if their “resuables” can stop executing the shortcode in the template ? but execute it only when used in a post ?
Aakash
KeymasterMarking this as resolved
June 2, 2021 at 11:04 pm in reply to: Use a shortcode in a template or reusable code and share #9529Aakash
KeymasterHi @Mathematica
Thanks for using WP Socializer.
It seems strange. May be as you guessed, the shortcode is getting executed by the template.
I’m not sure how this “templatera” works nor I use WP bakery that is not a free plugin.
But I can assess the issue faster or provide workaround if you can have a live look at the website.Can you please create a temp admin user and share the the details via contact form ?
If you are new to this, you can also use plugins like https://wordpress.org/plugins/controlled-admin-access/ to restrict certain pages and let me use only the pages you need me to see.
Thanks,
AakashAakash
KeymasterHi DPNOnline,
Please use my contact form to send your page URL where this issue is seen.
I’ll have a look.
Thanks,
Aakash -
AuthorPosts