I tried various solutions available in YouTube to remove the background music in my audio file, but none of the solutions quite worked for me. So, after some trial and error, I have arrived at this solution which has worked for me. You can give it a try.
Search blog
Monday, February 12, 2018
[SOLVED] - Remove Background Music/Noise Using Audacity
I tried various solutions available in YouTube to remove the background music in my audio file, but none of the solutions quite worked for me. So, after some trial and error, I have arrived at this solution which has worked for me. You can give it a try.
Tuesday, February 6, 2018
List of all Thunkable Apps in Google Play Store
If you would like to view the list of all the apps made using Thunkable in Google Play Store, please check the following link: http://bit.ly/2BHewYX.
Monday, February 5, 2018
[SOLVED]-Restrict Access to BuddyPress & bbPress Pages Without Using Any Plugins
If you would like to restrict access to specific page(s) of your Buddypress/bbPress site such as Groups, Forum or Member page from non-logged-in/guest users without using any plugins then use the solution below.
The code below will redirect all non-logged-in/guest users to your site's Registration page whenever they try to access a Buddypress/bbPress page such as Group, Forum, Member Page, Profile page etc
What the code above does is, it first checks whether a user trying to access a bp-page is logged in or not AND whether that bp-page is a BuddyPress blog page or a BuddyPress activation page, Profile page etc or NOT (! represents NOT in PHP), and if it is not any of the aforementioned BuddyPress pages, it will then redirect the guest user to your site's registration page.
You can replace 'register' with the slug of any page you would like the user to be redirected to. Suppose, you would like a non-logged-in/guest user to be redirected to your login page then replace 'register' with 'login'.
This was the solution I required for my site and sharing the same with you all below.
In the above code, what we’re saying is that:
- If a user is not logged in;
- && (equivalent to AND) one of a number of types of pages are being loaded viz. 'bp_is_members_component()', 'bp_is_user()' etc
- Then redirect to the registration page
The three things to note in the Solution 2 are:
1. $url defines a variable that saves the url the user is trying to access;
2. $explode_url is an array variable that contains a break down of the above url parts, so “bbc.co.uk/news/” would be broken down into “bbc.co.uk” and “news”;
3. And in the last portion, where I use in_array() I set some new criteria for what pages to block.
Here are the basics to this argument so you can decide what will work for you:
in_array("members", $explode_url) checks for “members” in $explode_url. So, let’s say I’m accessing a site http://gulfnepal.com and want to view http://gulfnepal.com/members/1 Because “members” is in the URL, the function will block access to this page for non-logged-in users and redirect them to the registration page.
In short, whatever is between the first set of quotation marks in the in_array("xxxx", $explode_url) argument will be tested against $explode_url, and if found the page will be blocked. In the second, I’m preventing non-logged in users accessing pages that include “members”. You can check your own site and see what terms would work best. Also, a variation of this method can be used to restrict access to categories of pages. Look at in_category( array( xx, xx ) ) argument.
Please go through the following two articles that I referred to while building the above solutions. You can come up with more solutions as per your requirement from them:
First, I recommend, you make use of this wonderful plugin called Code Snippets. Please read the description provided in its plugin page to know about its numerous benefit compared to pasting codes in your theme's 'function.php' file or 'bp-custom.php' file.
>> Solution 1: Restrict Access to all BuddyPress & bbPress pages
The code below will redirect all non-logged-in/guest users to your site's Registration page whenever they try to access a Buddypress/bbPress page such as Group, Forum, Member Page, Profile page etc
/**
* Redirect buddypress and bbpress pages to registration page
*/
function bp_redirect_pages()
{
//if not logged in and on a bp page except registration or activation
if( !is_user_logged_in() &&
( ( !bp_is_blog_page() && !bp_is_activation_page() && !bp_is_register_page() ) || is_bbpress() )
)
{
wp_redirect( home_url( '/register/' ) );
exit();
}
}
add_action( 'template_redirect', 'bp_redirect_pages' );
What the code above does is, it first checks whether a user trying to access a bp-page is logged in or not AND whether that bp-page is a BuddyPress blog page or a BuddyPress activation page, Profile page etc or NOT (! represents NOT in PHP), and if it is not any of the aforementioned BuddyPress pages, it will then redirect the guest user to your site's registration page.
You can replace 'register' with the slug of any page you would like the user to be redirected to. Suppose, you would like a non-logged-in/guest user to be redirected to your login page then replace 'register' with 'login'.
>> Solution 2: Restrict Access to Only Member's Directory & profile page
This was the solution I required for my site and sharing the same with you all below.
/**
* Redirect non-logged-in/guest user to registration page while trying to access Member's directory or BP-Profile page
*/
function bp_redirect_pages()
{
// Gets the URL for the page the user is trying to access
$url = $_SERVER['REQUEST_URI'];
// Breaks down the above URL into its parts and "news"
$explode_url = explode("/", $url);
//if not logged in and on a bp page except registration or activation
if( !is_user_logged_in() &&
( bp_is_members_component() || bp_is_user() || in_array("members", $explode_url) )
)
{
wp_redirect( home_url( '/register/' ) );
exit();
}
}
add_action( 'template_redirect', 'bp_redirect_pages' );
In the above code, what we’re saying is that:
- If a user is not logged in;
- && (equivalent to AND) one of a number of types of pages are being loaded viz. 'bp_is_members_component()', 'bp_is_user()' etc
- Then redirect to the registration page
The three things to note in the Solution 2 are:
1. $url defines a variable that saves the url the user is trying to access;
2. $explode_url is an array variable that contains a break down of the above url parts, so “bbc.co.uk/news/” would be broken down into “bbc.co.uk” and “news”;
3. And in the last portion, where I use in_array() I set some new criteria for what pages to block.
Here are the basics to this argument so you can decide what will work for you:
in_array("members", $explode_url) checks for “members” in $explode_url. So, let’s say I’m accessing a site http://gulfnepal.com and want to view http://gulfnepal.com/members/1 Because “members” is in the URL, the function will block access to this page for non-logged-in users and redirect them to the registration page.
In short, whatever is between the first set of quotation marks in the in_array("xxxx", $explode_url) argument will be tested against $explode_url, and if found the page will be blocked. In the second, I’m preventing non-logged in users accessing pages that include “members”. You can check your own site and see what terms would work best. Also, a variation of this method can be used to restrict access to categories of pages. Look at in_category( array( xx, xx ) ) argument.
Please go through the following two articles that I referred to while building the above solutions. You can come up with more solutions as per your requirement from them:
Tuesday, January 30, 2018
[SOLVED]-Access Wordpress Backend/Admin Login Page Even If Restricted by Custom Code
If you would like to access your Backend/Admin Login page, in spite of creating a redirection with some custom code/snippets, you can use the URL below to do that:
http://example.com/wp-login.php?redirect_to=&reauth=1
Subscribe to:
Posts (Atom)
Top 5 Posts (Weekly)
-
Blogs may get deleted in a number of ways. Once deleted a blog is not lost forever so do not panic. However it is always safer to backup you...
-
If you are unable to suspend your laptop, here's the solution which I've tried & tested and it worked with my Lenovo Thinkpad T4...
-
>> Download Links: SP Flash Tool (Linux/Windows) : http://bit.ly/2CZkTER SN Write Tool (Windows only) : http://bit.ly/2Aw22Ov ...
-
Don't know why Mageplaza haven't still listed the composer name of their paid extensions. Look at the comment section of thi...
-
Since yesterday, I've been trying to backup my hard drive using Clonezilla but without any success. Twice I got the following error, wh...