More
    Home Blog Page 2

    How to Use the Load More Posts Ajax Button in WordPress

    0

    To begin with, you need to install the WordPress plugin called Ajax Load More. If you are not sure how to do this, do a web search for instructions on installing WordPress plugins.
    After activation, the plugin will add a brand new item in the menu called Ajax Load More to your admin menu in WordPress. Click on the link and go to the plugin’s settings page.

    Once you are on the settings page for this plugin, you can choose what color you want your button to be. You can also change the button to be an infinite scroll which will load next set of posts automatically without requiring your users to click the button.

    Next, you should go to Ajax Load More >> Repeater Template page and add a template for displaying posts. The plugin comes with a simple template that contains the WordPress loop to show posts but it may not match your theme so may not look very good on your website.
    To solve this issue, you need to copy the WordPress code your theme uses to show posts on the index, archive, and blog pages of your website.

    Usually, this code is in the template-parts folder of your theme file directory. That folder should contain templates to display different types of content. These include the files content-page.php, content-search.php, and more.

    You will need to find the generic content.php template. After that code is found, you should look for the Repeater Templates field and past it in the Ajax Load More settings.
    Once that is done, click on the Save Template’ button to save your settings.
    Next, you should visit the Shortcode Builder page to create the shortcode. On this page you can customize lots of different options. First, you should select the type of container. If you aren’t sure, look at the template copied from earlier.

    Modern themes usually use the <div>; element. Next, scroll down to the section with button labels. You can change the text that is displayed on the button here. By default, the plugin uses Older Posts’ but you can change that text to be Load more posts’ or something else you want.

    Finally, you should to select if you would like posts to load automatically or if users should click on the button.

    The shortcode is can now be used. In the right column, you should see the shortcode output. Copy the shortcode and paste it in your favorite text editor. Once you save the changes, go to your website to see the Load more posts’ button in action.

    How to change a WordPress theme in MySQL

    0

    WordPress is a powerful blogging platform that has made a name for itself in the world of online journals. While there’s a stiff competition between WordPress and Google’s Blogger, the former is considered for professional and preferred by users who like working on the more technical side. Along with separate plugins and widgets, there’s a plethora of themes available for WordPress in numerous categories and designed in ways to cater to a certain need.

    Depending on the nature of your blog you can either go for a free theme or go premium which are paid and provide extra customization options and additional features. Premium themes are available in online tech stores and various market places. Prices vary depending on the effort and time that went into creating them, along with the number of other options they come with. There are tutorials available on how to install and edit them ccording to your taste as well as help and support from the creators in case the user is stuck somewhere.

    If you’re using a custom theme on your WordPress blog, sometimes  installing new plugins or updates may not support your current theme, which will result in denial of access to the control panel to deal with the issue. But there’s a solution available. You will have to login to MySQL database and either revert or make necessary changes in order for the updates to be compatible with your theme. Here’s how to change a WordPress theme in MySQL.

    Start by logging in to your database control panel that’s phpMyadmin. If you don’t have an idea how to do it, you will find the MYySQL database server on your webhosting service provider’s website. Login to your account to access phpMyadmin, but it is recommended to create backup of your data since any changes made cannot be reverted.

    Once you’ve entered, on the left side you’ll see “click wp_options”. Click it to reveal the options table.

    Look for the terms template and stylesheet within the rows. They should probably be present on page 2 within the table. Find and click option_value to make changes to the template. Then you can either switch to a default WordPress theme or use a new one which is compatible with the plugins and updates installed on your blog. Press enter and the made changes will be saved. Repeat these steps for stylesheet and that should solve the problem.

    Your WordPress theme is now accessible and you can also enter the control
    panel.

    There are also various other tutorials and detailed instructions available on the internet for those who don’t know how to handle technical issues. Or you can ask someone else to do it for you.

    How do I add a simple jQuery script to WordPress

    0

    How do I add a simple jQuery script to WordPress? This is one of the questions many WordPress site owners are searching for answers. If you are one of them, I have shared a quick tutorial that I hope will answer any of the questions you might have about adding jQuery script to WordPress.

    Here’s how I do it

    Step 1: The first step is to make a new JavaScript file and put it in the desired theme folder. To do this, just go to your WordPress theme folder and create a subfolder and name it ‘js’. Add a file in the subfolder and then name it custom_scripts.js. Below is an example of the jQuery script that could go into this file.

    jQuery(document).ready(function($){
        $('#nav a').1ast().addClass('1ast');
    });

    If you are familiar with jQuery, you may be asking why there is no $ sign at the beginning. In fact, the reason you are not seeing the dollar sign is because jQuery is variable name. jQuery is used instead of $ to avoid any conflicts with the WordPress theme.

    Step 2: The next step is to add the custom_scripts.js into your theme’s functions.php file. If you are creating a theme from scratch or using a child theme, chances are there is no functions.php file in your theme. So you need to add it to your theme.

    To add your custom_scripts.js file, just open your theme’s functions.php file. Then copy and paste the code below into the functions.php file. You can also add the file using the wp_enqueue_script() function.

    The code to add is:

    add_action( 'wp_enqueue_scripts', 'add_my_script');
    function add_my_script(){
    //name your script to attach other scripts and de-register, etc.
    wp_enqueue_script{
    'new',
    get_template_directory_uri() . '/js/add_my_script.js',
    array('jquery') // this array lists the scripts upon which your script depend
    );
    }
    

    If your theme has wp_footer and wp_head files, the jQuery script will be added in the header and footer sections. The only area where the script will not be loaded is in the admin pages.

    Adding jQuery script to the WordPress Admin

    Now it is time to add the jQuery script to the WordPress Admin. The process is quite simple and straightforward. All you need is to copy and add the code below into your theme’s functions.php file.

    function my_admin_scripts(){
    wp_enqueue_script( 'my-great-script', plugin_dir_url(FILE__ ) . '/js/my-great-script.js', array('jquery'), '1.0.0', true );
    }
    
    add_action( ‘admin_enqueue_scripts', 'my_admin_scripts' );
    

    As you may have noticed, the code for adding jQuery script to the WordPress Admin is almost the same as the one used previously.

    If you still need help on how to add a simple jQuery script to WordPress or any other WordPress related questions, just feel free to let me know. I will be happy to help you.

    How To Call Shortcode Within a WordPress template

    0

    Most WordPress plugins and widgets offer their functionality through shortcodes. Now one of the questions many people are asking is on how to call a shortcode within a WordPress template or how to use shortcodes within a WordPress template.

    So if you are one of those people who are wondering how to call shortcodes or use shortcodes within a WordPress template, I’ll have you sorted. I’m going to reveal the answer I’ve been sharing in many forums. But before then, let’s first understand what WordPress shortcodes are.

    Shortcodes in WordPress

    These are special tags that allow you to add a bunch of cool things to your site’s pages and posts. Some of the things you can add to your site using these shortcodes include galleries, column layouts, contact forms, buttons, social media buttons, blockquotes and much more.

    Through WordPress shortcode API, you can easily create your own WordPress shortcodes and add them to pages and posts. But what if you want to use WordPress shortcodes within WordPress templates instead of within pages or posts? You can do this by adding various functions to the functions.php template. Read on to find out how you can do this.

    Adding Shortcodes in the PHP template

    There are several ways you can do this. The one I recommend most in various forums is through the standard WordPress do_shortcode function. This function was created specifically to accomplish this task. However, before you insert this function in the theme template, you need to add a little PHP coding prior to that.

    Use this code:

    <?php echo do_shortcode("[place your plugin shortcode here]"); ?>

    Sometimes this shortcode may fail to work simply because of the double quotation marks in them. If this is the case, then try it out with single double quotation marks as shown below.

    <?php echo do_shortcode('[place your plugin shortcode here]'); ?>
    If your page is calling the shortcode template instead of its respective name, just try the code below.
    <?php echo do_shortcode ('[place your plugin shortcode here]' ('name of your shortcode' ) ); ?>
    For instance, if it’s the Contact Form shortcode you want to place into your theme’s template, try something like:
    <?php echo do_shortcode('[CONTACT-FORM]'); ?>
    If you still need help on how to call Shortcode or use shortcodes within a WordPress template or any other WordPress related questions, just feel free to let me know. I will be happy to help you.

    How to Reset a WordPress Password from phpMyAdmin

    0

    You decided to use WordPress to set up your personal or professional website. You’ve been working really hard to come up with an impressive layout, a catchy landing page with a creative theme, not to mention all those on-site functions that make your website unique, user-friendly and fast. As you dived into working on your dream website you forgot about your admin WordPress credentials, and now you can’t log into your WordPress dashboard to make the final changes before actually publishing your website. So, as you try to retrieve your credentials using the “Lost your password?” function you realize that the system is not recognizing your email address and you are not receiving the recovery information you need to get access back.

    The easiest and most practical solution is using phpMyAdmin, thanks to which you will be able to reset your WordPress password by accessing the database of the platform. With these brief guide, hopefully, you will be able to move on with your project and publish a terrific website as soon as possible.

    Here’s what you have to do on pHPMyAdmin.

    You will need to log in the dashboard of your WordPress hosting account, then you will click on the phpMyAdmin icon. This will launch the software and you will be presented with a list of tables that correspond to specific sections of your WordPress site. What you will be looking for precisely is a table labeled “users”. Then you will need to click on the “browse” link and you will be presented with a list of WordPress usernames. In the case you are only hosting one account you will only have one username on that list, which is the one you are trying to recover the password for. Now, on the row that contains your user ID, you will have to click on “edit”. On the same row, you will see a column labeled “user_pass”. That’s where you will be able to change your password. The procedure will be completed by selecting the “MD5” option under the “Function” column. This will ensure that the password will be correctly encrypted into the database. Click “Go”, now your new password is all set and you are ready to log in your WordPress dashboard again. This time, make sure you write down your credentials so that you won’t forget them anymore and you won’t be slowed down.

    Give yourself some time to work through the phpMyAdmin software, follow this article to the letter and you’ll be good to go. But if you can’t make any sense of it, don’t stress yourself out, you can look for video tutorials for a step-by-step guide on YouTube. Using phpMyAdmin is easier done than said.

    WordPress Errors: Can’t Create Directory

    0

    As a WordPress user, there are times whereby you are unable to make any kind of progress with your project owing to a number of errors. For instance, did you know that the inability to create a new directory within your WordPress project structure can disable you from adding anything to your website or application? Usually, the issue lies with the permissions structure and if not properly or correctly configured, these permissions can prevent you from writing files into your project structure. When, in the course of your WordPress project, you find yourself not able to create new folders, then this means that your administrative privileges are insufficient to reach the core of the project.

    Whenever you find that WordPress cant create directory error, try looking first at your permissions from the level of the web administrator to determine which locks have been allocated mistakenly and what to be done to enable the writing of new files. Memory issues are also a leading cause of the error as a full drive will not allow any new writes unless some of the files have been first moved to create space for the new files. At times, you could even be trying to add a new page to your web layout but run into the same errors as a result of less than sufficient memory. Modifying permissions is one of the most popular ways of working your way around this problem in addition to making updates to your wordpress core and plugins to flush out any problems. In some cases, changing into root user gives you more permissions to change the directory structure and make sure your current project resides in a rewritable drive.

    This very same error also arises when you are making updates to your wordpress core and you will always face the same message when unpacking the files that are included with the update. As a root user, you can override the directories but when you switch back into a normal user, access to these files will be restricted. The best way of going around these errors is to get your permissions right and work within folders and drives that do not have restrictions for writing new files. This way, you will be able to fix directory errors and enable the easy addition and modification of your WordPress projects.

    How to: WordPress WooCommerce Catalog Mode & Disable Shopping Cart

    0

    WordPress is an e-commerce enthusiast’s dream. It allows you to create swanky websites with relatively little effort. Every once in a while though, you come across a problem the solution to which isn’t so readily apparent.

    Fortunately, the solutions are only a few steps away. Here we’ll be looking at how to create a product catalog using catalog mode and how to disable shopping carts on WordPress WooCommerce.

    How to enable Catalog Mode on WordPress Woocommerce

    Enabling WordPress WooCommerce catalog mode is easy.

    To do this, you’ll need to install the WooCommerce catalog plugin. Go to the WordPress plugin directory, click on settings, and under that, select ‘WooCommerce catalog mode’. This will allow you to toggle the catalog mode and perform other neat tricks as well, such as
    hiding the prices and toggle the ‘add to cart’ button.

    Catalog for WooCommerce is another plugin you can use. You simply have to go to ‘Catalog Mode’ on the dashboard once it’s been activated and check all the options you want, which include catalog, ratings and more.

    You can also install the YITH WooCommerce Catalog Mode. This plugin has both a paid and free version, with the former letting you hide the prices, add custom buttons and inquiry forms. Once downloaded, you can enable catalog mode by navigating to YITH plugins and then catalog mode. It’ll let you do a few other things as well.

    How to Disable Shopping Carts on WordPress Woocommerce

    All of the above plugins will let you remove the shopping cart from the plugin page. There are a few ways to disable WordPress WooCommerce shopping carts though. You can also prevent the shopping car from showing by not listing the price of a project. However, you can also use the ‘remove_action’ function on the functions.php file to prevent a product with a
    particular ID from being purchased. Here’s the code:

    add_filter('woocommerce_is_purchasable', 'woocommerce_cloudways_purchasable'); 
    
    function woocommerce_cloudways_purchasable($cloudways_purchasable, $product) { return ($product->id == your_specific_product_id (like 22) ? false : $cloudways_purchasable); }

    And that’s it! You can now enable catalog mode
    and disable shopping carts!

    How to Fix the WordPress Not Sending Registration Emails Issue

    0

    One of the most frustrating things about setting up WordPress is the failure to get email notification from new registrations. What is even more frustrating is that this is a
    very common issue that occurs without a specific warning. As a WordPress admin, you don’t want a situation where you are soliciting for new users and getting non. In most instances where WordPress does not send registration email, the problem could be a WordPress misconfiguration, an incompatibility or a problem on the hosting server.

    Solution 1: Testing WordPress misconfiguration and incompatibility issues

    The first thing you would want to do is install the free Check Email plugin. This plugin is designed to simply check whether your WordPress installation or server can send emails. Once installed click the “Check Email” label which is under the tools menu of the dashboard. Enter a valid email address in the text box labelled “Send-test-email-to” and click “Send test email”. You will then have to check your email client to see if you received the mail. If you received the mail then this means that WordPress can definitely send emails on your web server. This will simply mean that there is a misconfiguration with your contact form plugin or an incompatibly. At this point you can talk to your hosting provider to check whether any outbound connections on specific ports have been blocked. WordPress by default uses the mail-function in PHP to send mails, however many shared-hosting providers disable
    this to avoid abuse.

    Solution 2: Setup SMTP in WordPress

    To setup SMTP in worpress you will need an email address (this can be your domain email address), your password and SMTP port. This information can be found on your cpanel or your hosting providers website. You will also need to install and then activate the WP-Mail-SMTP plugin. Once activation is done, go to “Settings” then “Email” to configure the plugins settings. You will need to input your correct email address, “from name” and check the “Send-all-WordPress-emails-Via-SMTP” checkbox option. Under the SMTP section, input your correct SMTP host and port details. For encryption, select “SSL-for-encryption”. Under the authentication area, check “Yes: Use SMTP authentication.” option and enter your SMTP-login details. You can now save your settings and test your email.

    How to Change Default Language in WordPress WooCommerce

    0
    How to Change Default Language in WordPress WooCommerce
    How to Change Default Language in WordPress WooCommerce

    As many people already know, WooCommerce is a WordPress plugin used by developers for building e-commerce platforms. It comes with a lot of benefits which helps in setting up e-commerce stores. However, despite its many benefits, many people have a hard time changing the default language.

    The default language in WooCommerce is English Language, so if the content of your website is in another language, you’ll need to change the default language to the language of your choice. And this is the area where most people get stuck. In this article, we will provide you instructions on how you can easily change the default language in WooCommerce.

    WordPress WooCommerce How to Change Language

    The following steps are to be taken if you want to change the default language in WooCommerce:
    • Step 1: Enter language code in wp-config.php to set WordPress language. To do this, enter define (‘WPLANG’, ‘da_DK’);
    • Step 2: The next thing you’ll need to do is to create a new directory in ‘wp-content’ directory, name this new directory ‘languages’.
    • Step 3: Visit http://translate.wordpress.org/, and choose your preferred language code. After selecting your preferred language code, you’ll be redirected to a new page where you’ll need to select the appropriate WordPress version from a list of options.
    • Step 4: After completing the above step, an option for download will come up. Scroll down until you see a file with the name “.mo”. Select the file, and click on “Export”. After clicking on “Export”, the download of the “.mo” file will commence. After the download is completed, convert filename to language code, then move the “.mo” file to the new directory created in step 2 which should be “wp-content/languages/”.
    • Step 5: Visit http://github.com/woocommerce/woocommerce-language-packs for WooCommerce translation packages. Choose the right translation pack and extract it from the zip folder.
    • Step 6: On your screen, navigate to WordPress admin panel > settings > general, then select the new default language of your choice.
    By following the the above steps, you’ll be able to successfully change the default language in WordPress WooCommerce.

    WordPress: WooCommerce add to cart button is missing

    0

    This will be a fairly basic tutorial on how to handle a simple problem within the woocomerce system, specifically what to do if the woocomerce add to cart button is missing. This is a fairly common problem, with a variety of causes, that can be fairly irritating to solve. I’ll be running you through a quick selection of diagnoses for the problem, and what you can do to fix them.

    Diagnosis: Theme Issues

    There are some problems with certain woocomerce themes, in particular the Bazar theme is known for causing problems. If you switch to the default theme and the button reappears, then you have a theme issue. This can be resolved by rolling back to an earlier version of the theme, or by switching themes altogether.

    Diagnosis: Code Issues

    There may be some issues with the default options in the coding within WordPress itself. By default, if you have the same price for variations woocomerce hides the price and the add to cart button for simple products. If this is happening to you add this code into the functions php add_filter('woocommerce_show_variation_price’, function() { return TRUE;}); and the problem should be resolved.

    Diagnosis: Missing Information

    The add to cart button will not be added unless a product is fully recognised as a finished and presented product by the site. This means providing all the relevant information. Make sure you have included weight, dimensions, ID, prices and stock keeping unit. Do a quick double check of your product descriptions and make sure everything you needed to provide is there.

    Diagnosis: Extension or Plugin Difficulties

    This is the most common and easiest to test and resolve problem. You may have some plugin, custom CSS or extension that doesn’t’ work well with woocomerce or your theme. All you need to do is turn those off and the problem should vanish quickly.