WordPress Tricks

If slug or portion of URL matched then redirect it to different URL using htaccess file.

Basically this is a solution of broken link in wordpress. As broken link cause issues in SEO, so you may need to redirect a bulk amount of urls to different url. So here I am sharing you a solution which basically I found working.

Client wanted to redirect all urls ( which was showing 404 error ) containing specific slug ( like category/success-story/) to be redirected to a different URL. Here is the code i used and put it in htaccess file of wordpress root folder.

<IfModule>
RewriteEngine on
RewriteRule ^(.*)url-slug/url-childslug(.*)$ https://www.your-site-url/page/about [L,R=301]
</IfModule>

Just replace the slugs and url as per your requirement.

WordPress Tricks

WordPress Blog Post Search Form Code: Only Post Search and Exclude pages and others

If you need to put a search form to show blog post based on the search term, you can use the code I shared. Generally normal search form may show you result from pages and other custom post type. But here I used the form which is used to show only blog posts.

wordpress blog post search form
Continue reading “WordPress Blog Post Search Form Code: Only Post Search and Exclude pages and others”
WordPress Tricks

Accepting Tips or Donations in your site: Buy Us or Buy me a coffee

Those who are creators, artists, teachers, service providers and have websites, they can use this Tip Jar WP plugins to accept tips or donations etc. Actually I found one of my client using this plugins and i helped her configuring it and did some css changes to make it fit by changing the width and font size. If you are using you can ask question in the comments section.

Continue reading “Accepting Tips or Donations in your site: Buy Us or Buy me a coffee”
WordPress Tricks

Sobe: WordPress lighthearted personal blogging theme by Automattic, Modifications or customizations with css.

Theme Sobe is a lighthearted personal blogging theme by Automattic for sharing life’s most memorable moments. You can see the Demo of theme Sobe. If you want to use it in your personal blogging site, you can download Theme Sobe from WordPress.com theme repository, or from here.

theme sobe wordpress modifications using css

Here, I will share with you some css customizations which you can use to modify the header font size, color, contents etc. If you have any questions feel free to ask in the comments section.

Continue reading “Sobe: WordPress lighthearted personal blogging theme by Automattic, Modifications or customizations with css.”
Contact Form 7 Issues Tricks and Solution

How to make Submit button of Contact Form 7 inactive or disable but keeping the form live

You can show the Contact Form 7 form in your live site, but can make the Submit button remain disable so that no one can submit it . Here I am sharing you a piece of jQuery code using which you can make the Contact Form Submit button block or inactive.

de

Here is the jQuery code

Continue reading “How to make Submit button of Contact Form 7 inactive or disable but keeping the form live”
Web Development

How to add own custom font without the help of plugins in wordpress or any sites.

Here I am sharing the small procedure about how to use own custom font without the help of plugins in wordpress site. This procedure can be used for any type of sites or platform.

Here are the steps:

  1. At first upload your choiceable font ( which you want to use in the site ) in the root directory using ftp or through cpanel. I have attached screenshot for better understanding
Continue reading “How to add own custom font without the help of plugins in wordpress or any sites.”
Web Development

How to add a spinner just above the submit button of form without modifying php code using JQuery

Actually this is little bit advanced technique, you need to have a good idea regarding jQuery. Basically I had to add a spinner just before the submit button of the form, so that viewers get idea that the form submission is working and they don’t get confused.

Here is the JQuery Code I used:

Continue reading “How to add a spinner just above the submit button of form without modifying php code using JQuery”
Contact Form 7 Issues Tricks and Solution

How to create Terms and Condition checkbox with a link in Contact Form 7

If you want to create a Terms and Condition Checkbox with the link pointing to the page, you can create it easily. Here is the code which you need to use

 [checkbox* terms-condition "I have read and agree to the terms and conditions. *"] <a href="http://www.yoursite.com/terms-and-condition"> Terms & conditions </a> 

The code will go in the Contact Form 7 ( like below)

Thats it. If you have any Question feel free to do comments below.

WordPress Tricks

Redirect Logged out users to different page based on Body Class : WordPress redirection using php and jQuery

Suppose you want your visitor not to see any specific pages and want them to redirect to login or register page, then you can do this using this following code. Here i used the body class of wordpress page. Using the Body class and using php and jquery you can redirect it .

<?php
   $classes = get_body_class();
if (in_array('my-profile',$classes)   || in_array('page-id-2324',$classes)    ) {

if( ! is_user_logged_in() ) {
     ?>
  <script>
 window.location.href = "https://yoursiteurl.com/register/";
  </script>	      
     
<?php
}} 
?>

WordPress Tricks

WordPress theme Twenty Twenty-One: Modifications and customizations of headers, fonts, styles and more

WordPress 5.6 comes with a brand new default theme: Twenty Twenty-One. Here I am sharing you some basic css or style modifications using which you can give it a look of your own. I have added the child theme below which you can download and use without any issue.

Download Twenty Twentyone Child theme.

wordpress theme twenty twenty-one
Continue reading “WordPress theme Twenty Twenty-One: Modifications and customizations of headers, fonts, styles and more”