How to increase WordPress Memory Limit

In this tutorial, we are going to show you how you can increase your WordPress memory limit using various methods.

If you are getting an error saying something along the lines of “Not Enough Memory allowed for PHP. You have 32 MB. You need at least 64MB” then you can usually resolve this by completing one of the below steps:

How to Increase WordPress Memory Limit

1.) Edit your wp-config.php file and enter something like:


    define('WP_MEMORY_LIMIT', '64M');

2.) If you have access to your PHP.ini file which you can usually access via cPanel or Plesk, change the line in PHP.ini

If your line shows 32M try 64M:-


    memory_limit = 64M; #Maximum amount of memory a script may consume (64MB)

You can always contact your web hosting provider to make the change if you are unsure.

3.) If you don’t have access to PHP.ini try adding this to your .htaccess file:


    php_value memory_limit 64M

If none of the above works for you, the only option you have is to contact your host and they can quickly get this resolved for you. If you want some support, you can always get in touch with our team or leave a comment below.

 

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well as many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

How To Fix “Unable to connect to the filesystem. Please confirm your credentials” In WordPress

If you are running XAMPP on localhost using OS X then you may have encountered one of the following errors:

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Unable to write to wp-config.php file.

The first error you may find will occur when uploading a plugin or theme. The third error you will notice when you are trying to install WordPress.

Both errors are caused by the same issue, this is because the default XAMPP user is set to daemon on Mac which causes the permission issues. WordPress tries to write files prior to upgrading and will check which user tried to write it. If the user doesn’t match the file it is trying to write then it will simply refuse to perform the action. Even if the permissions are set to 777, this will still not allow you to perform these actions.

The correct way to fix this issue is by opening your httpd.conf which is located here; /Applications/XAMPP/xamppfiles/etc/httpd.conf and simply change the user and group. The user and group might differ so a quick way to find the lines of code we need to edit is to search for User/Group. For us, we had to change lines 173 and 174 from:


User daemon
Group daemon

to


User your_mac_username
Group staff

Once you have made the change, restart XAMPP and this should rectify the problem.

If you are still having issues you can check a couple of other things. Firstly we can verify the ownership by opening Terminal and running the below command:


sudo chown -R your_mac_username:staff /path_to_webroot/www/

Secondly, we can confirm permissions and ensure all directories have 755 and files have 644 (which is the correct access level). To do this we can run the following command in terminal:


find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;
find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;

And that should be the permission issues solved!

There are other methods to fix this but this is definitely the best one to go for! We’ll show you another way to resolve the issue anyway incase you are interested.

The second method can be fixed by simply adding the following code your functions.php file:


define( 'FS_METHOD', 'direct' );

You may also need to amend the permissions of the directory of your website. To do this we can right-click the folder and click Get Info. Once here, we can change admin and everyone to have Read & Write permissions. We can then click the padlock key and then click the ellipsis icon (circle with three dots) and click ‘Apply to enclosed items…’

This will also rectify the issue although it’s not the preferred method. Also, you will find yourself having to perform the same action for every project so you may as well do it the right way first 😉

Well, we hope we managed to resolve your WordPress permission issues today. Let us know in the comments below if you found this useful.

If you need help setting up VirtualHosts in XAMPP on Mac you can take a read of this blog.

 

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well as many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

Add Instagram Photos to Your Website or WordPress Website

In this tutorial, we will show you how you can add an Instagram feed using a WordPress plugin, and how you can add one using an external plugin for any type of website.

Adding Instagram Photos to your website using a Premium WordPress Plugin

The best plugin in which we have come across and use on a lot of our website builds is Instagram Feed – WordPress Instagram Gallery which is created by Elfsight. The plugin can be purchased here. This plugin can be purchased for $59 and can be used across multiple WordPress websites.

All you have to do is install the plugin, activate it and connect your Instagram account either using Facebook Business or Personal Instagram and then you can fully customise it to your needs.

A shortcode is provided so that you can add it anywhere on your website. The beauty of this plugin is that it’s very easy to use, it allows you to fully customise the appearance. You can use either a slider or tile display, specify how many items you want per row or column, and it even allows you to hover the images to see the post description, amount of likes, and comments which links to the feed. Sounds awesome right? That’s exactly why it’s our go-to plugin for Instagram feeds on WordPress websites.

The best part of using a plugin for this sort of thing is that Instagrams policies are forever changing, so by simply updating to the latest version, we can always ensure this plugin works as intended.

Here is an example of how this plugin looks on your WordPress website:

We actually use this plugin on this website which you will see just above the footer. You will see the description and comments/links in the first image above.

Looks great right?

We’ve used a variety of plugins, but this one has definitely proved to be the best on the market!

Add Instagram Photos to your website using Instafeeed.js

We came across a really good light-weight plugin to add Instagram photos to your website and this was by using Instafeed.js. No jQuery required, just plain old javascript.

https://raw.github.com/stevenschobert/instafeed.js/master/instafeed.min.js

How do I set it up?

Setting up Instafeed.js is pretty straight-forward. Just download the script and include it in your HTML:


<script type="text/javascript" src="path/to/instafeed.min.js"></script>

Instafeed.js also supports AMD/CommonJS:


// AMD
require(["path/to/instafeed"], function(Instafeed) {

});

// CommonJS
var Instafeed = require("instafeed.js");

NPM/Bower

Instafeed.js is also available on NPM and Bower:


npm install instafeed.js      # npm
bower install instafeed.js    # bower

Basic Usage

Here’s how easy it is to get all images tagged with #awesome:


<script type="text/javascript">
    var feed = new Instafeed({
        get: 'tagged',
        tagName: 'awesome',
        clientId: 'YOUR_CLIENT_ID'
    });
    feed.run();
</script>

Instafeed.js with automatically look for a

and fill it with linked thumbnails. Of course, you can easily change this behaviour using the standard options. Also, check out the advanced options and the section on templating for additional customizations.

Requirements

The only thing you’ll need to get going is a valid client id from Instagram’s API. You can easily register for one on Instagram’s website.

If you need help with that step, try Googling “How to get an Instagram client ID“.

Standard Options

  • clientId – Required. Your API client id from Instagram.
  • accessToken – A valid oAuth token. Can be used in place of a client ID.
  • target – The ID of a DOM element you want to add the images to.
  • template – Custom HTML template to use for images. See templating.
  • get – Customize what Instafeed fetches. Available options are:
    • popular (default) – Images from the popular page.
    • tagged – Images with a specific tag. Use tagName to specify the tag.
    • location – Images from a location. Use locationId to specify the location.
    • user – Images with a user. Use userId to specify the user. More info here.
  • tagName – Name of the tag to get. Use with get: ‘tagged’.
  • locationId – Unique id of a location to get. Use with get: ‘location’.
  • userId – Unique id of a user to get. Use with get: ‘user’.
  • sortBy – Sort the images in a set order. Available options are:
    • none (default) – As they come from Instagram.
    • most-recent – Newest to oldest.
    • least-recent – Oldest to newest.
    • most-liked – Highest # of likes to lowest.
    • least-liked – Lowest # likes to highest.
    • most-commented – Highest # of comments to lowest.
    • least-commented – Lowest # of comments to highest.
    • random – Random order.
  • links – Wrap the images with a link to the photo on Instagram.
  • limit – Maximum number of Images to add.
  • resolution – Size of the images to get. Available options are:
    • thumbnail (default) – 150×150
    • low_resolution – 306×306
    • standard_resolution – 612×612

Advanced Options

  • before – A callback function called before fetching images from Instagram.
  • after – A callback function called when images have been added to the page.
  • success – A callback function called when Instagram returns valid data. Takes the JSON data as an object argument.
  • error – A callback function called when there is an error fetching images.Takes an error message as a string argument.
  • mock – Fetch data without inserting images into DOM. Use with success callback.
  • filter – A function used to exclude images from your results. The function will be given the image data as an argument, and expects the function to return a boolean. See the example below for more information.

Example Filter (get username + tagged):


<script type="text/javascript">
    var feed = new Instafeed({
        get: 'user',
        userId: 'USER_ID',
        filter: function(image) {
            return image.tags.indexOf('TAG_NAME') >= 0;
        }
    });
    feed.run();
</script>

Templating

The easiest way to control the way Instafeed.js looks on your website is to use the template option. You can write your own HTML markup and it will be used for every image that Instafeed.js fetches.


<script type="text/javascript">
    var feed = new Instafeed({
        get: 'tagged',
        tagName: 'awesome',
        clientId: 'YOUR_CLIENT_ID',
        template: '<a href="{{link}}"><img src="{{image}}" /></a>'
    });
    feed.run();
</script>

Notice the {{link}} and {{image}}? The templating option provides several tags for you to use to control where variables are inserted into your HTML markup. Available keywords are:

  • {{type}} – the image’s type, can be image or video.
  • {{width}} – the image’s width, in pixels.
  • {{height}} – the image’s height, in pixels.
  • {{orientation}} – the image’s orientation, can be square, portrait, or landscape.
  • {{link}} – URL to view the image on Instagram’s website.
  • {{image}} – URL of the image source. The size is inherited from the resolution option.
  • {{caption}} – Image’s caption text. Defaults to empty string if there isn’t one.
  • {{likes}} – Number of likes the image has.
  • {{comments}} – Number of comments the image has.
  • {{location}} – Name of the location associated with the image. Defaults to empty string.
  • {{id}} – Unique ID of the image. Useful if you want to use iPhone hooks to open the images directly in the Instagram app.
  • {{model}} – Full JSON object of the image. If you want to get a property of the image that isn’t listed above you access it using dot-notation. (ex: {{model.filter}} would get the filter used)

 

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well as many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share