Lorik84
Forum Replies Created
-
Well, it did work a little.
I realized I forgot to substitute “$user” on the second line, with “$current_user”.
The final code I concocted is this:
<?php $current_user = wp_get_current_user($role);
$current_user->set_role(“Gold Client”); ?>For some reason though, and I have tested this with all roles, even the default wordpress subscriber and editor roles, but it changes the users role to “None”.
So there must be some line of code that I need to add, in order to update the database with the new role. It’s just taking the current user’s CURRENT role away.
Hopefully someone can help me figure this out soon?? Still trial and erroring 7 hours later…
Update: I didn’t notice this until recently, but my entire sidebar gets taken off when I save the php code in the main tag. I noticed that the only part of the custom page template where I can add any php is at the very bottom. Putting it at the top makes the page display a 404 error.
But even with adding it to the very bottom it does not work!
I also researched some more and if you go to this page:
https://codex.wordpress.org/Class_Reference/WP_User#add_role.28_.24role_.29It actually says that if we are not referencing a specific user to use this:
<?php $current_user = wp_get_current_user(); ?>
so I thought that maybe I just needed to replace the first line: $user = new WP_User($userid);
with that get_current_user code, that it would work.But nope. Still dont work.
Added this “made up” two-line code to my page inside wordpress text editor after failing with the custom page template, using the insert php shortcode, and it actually removes all page content! So it didn’t even like the newly added code I placed in it, so must not be proper, so obviously I am not using the “get_current_user” line the right way.
So how do I use the get_current_user function so that I don’t have to only identify a specific user, and then add the function of “add_role”?
This is so confusing. It must take coders years and years to understand all this stuff!
I have the same problem… on the widget it shows to guests “You don’t have permission to view this content”. That looks kinda unprofessional to people who have not yet signed up.
Do you remember how you took that off? I am new to php so clear instruction would be awesome! Either Sarah or author response would be appreciated ASAP.
Never mind! Don’t know what was going on the other day, but I logged back out of my admin panel and back in, and checked off the admin debug just to test it out again. And now it works! Maybe there was something going on with my cache at the time.
Thanks for your time. 🙂
Hi,
Actually I should have mentioned that I have two targeting conditions checked (but like I mentioned before, I have “tested” every single targeting condition, some tests were done on every single condition where it was the ONLY condition, some tests were done where there were 2 different conditions of all different types of conditions and scenarios).
I did have auto open selected as well on all of my tests. Some tests were done with no (“0”) delay, and other tests were done with 2,000 ms delay.
Even if the script didn’t recognize that “auto open” was selected, there was still nothing that showed up on this page, I moused over every square centimeter of the page, triggering no manual-open popup.
I guess my question should be, is there any hosting requirements that we may need in order for this to work?
What’s confusing is the debug/admin mode works fine for admin. But when unchecked, it doesn’t work for anyone.
Thanks again,
LoriAlso, I would actually like to make it uncloseable for 10 seconds (not just 4.6 seconds)… but I guess I can’t? Do you have this option in your pro version?
Also, whenever I uncheck “checking this causes the popup to be fixed”, and then click “save”, it shows that it’s still checked. It won’t allow me to uncheck it…
Never mind… I disabled your firewall and it still is not working. I really dont know what is going on…
Forum: Plugins
In reply to: [WP Private Content Plus] Shortcodes?Thank you 🙂
Just in case you misunderstand, I do realize that your content IS restricted, and can’t be visible by refresh, when it’s customize to not show at a specified time or date.
But of course with my situation, I only need to restrict it based on how long they have been viewing that page. So it can be at ANY time of the day, and on ANY date.
Just wanted to clarify… thanks. 🙂
Forum: Plugins
In reply to: [Rencontre - Dating Site] Hello your plugin isn't working on my websiteAlso, what pages are for customizing the wording? I can’t find them anywhere. I want to change the wording of some of the questions.
Forum: Plugins
In reply to: [Rencontre - Dating Site] Hello your plugin isn't working on my websiteHi,
I just wanted to say that I decided to use the “2013” theme, where I added this code to the index.php file (the one located on your FAQ of the plugins details):
<?php // theme 2013
/**
Template Name: page-rencontre
*/
get_header(); ?>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”>
<div class=”site-info”>
<?php if(is_user_logged_in()) {$renc=new RencontreWidget; $renc->widget(0,0);} ?>
<?php if(!is_user_logged_in()) Rencontre::f_ficheLibre(); ?>
</div><!– .site-info –>
</div><!– #content –>
</div><!– #primary –>
<?php get_footer(); ?>And everything works perfect. There are NO issues when using the 2013 theme. Even the registered users that I signed up through the register/login links, are showing up under the “members” tab, unlike before when I was using the new “2016” theme.
So the issue is NOT that I did the installation wrong, or missed any of the fields. The issue is simply that the new 2016 theme is different than the other themes, in that maybe it does not allow the total fuctionality of your template/code.
Anyway you can figure out what the full php code should be for 2016 theme? I really like that theme the best.
Thanks,
LoriForum: Plugins
In reply to: [Rencontre - Dating Site] Hello your plugin isn't working on my websiteOh and yes I do see the links:
•My homepage
•My card
•Edit My Profile
•Messaging
•Search
•My Accountafter logging in. But it won’t let me click on any of those links until AFTER I submit the 4 questions. But the send button doesn’t do anything after clicking.
Forum: Plugins
In reply to: [Rencontre - Dating Site] Can't get it to workOh and yes I do see the links:
•My homepage
•My card
•Edit My Profile
•Messaging
•Search
•My Accountafter logging in. But it won’t let me click on any of those links until AFTER I submit the 4 questions. But the send button doesn’t do anything after clicking.
Forum: Plugins
In reply to: [Rencontre - Dating Site] Can't get it to workHi Jacques,
Please respond in the new topic I just created.
As it mentions on there, the user I registered, DOES show up in the wp users. But it does NOT show up in the Recontre/members tab.
And yes I am able to login, that’s how I was able to see the 4 questions that I said I tried to answer, but for some reason, the “send” button isn’t doing anything after clicking it. Even though I answered all 4 questions.
Same thing for the other 2 registered users I created using your register/login links. They ALL show up in the main Users list for wordpress. But NOT in your plugin.
Thanks,
Lori