Quick Snippets for Enfold Child Theme

I have been a big fan of the Enfold Multipurpose WordPress Theme developed by Kriesi. I use it for almost every WordPress website that I create for my clients. Also, You may have already noticed; I also advertise the theme on this site.  As the theme is extremely flexible and very well coded, it has become my all time favorite for any WordPress project.

While working on different requirements and features wanted by the clients, I have gathered a good amount of snippets that I often use for the theme. I have listed a few of them below for everyone’s convenience.

 

Thing You Should Follow

  • The codes provided may not work for older versions of the Enfold Theme. The theme has gone through a lot of updates and improved a lot. Just check out the huge list of changelog!
  • It is critical, making sure you are using a child theme over the parent theme (in this case the Enfold Theme) and always should be followed regardless of whatever theme you are using.
  • Use the codes given below on the functions.php file of your child theme.
  • In some cases, there are CSS and HTML codes which you may add on custom.css and to the file you are working.

 

Enable Custom CSS Class Field for Advanced Layout Builder Elements

To be able to customize is the most important aspect of a WordPress theme for me. I fine tune my projects a lot – pixel by pixel if it needs to be. For this task, using Custom CSS Classes helps a lot. Simply add the code given below to enable the field.

 

Disable Layerslider

As much as I like the theme, I wish it had Revolution Slider instead of LayerSlider provided with the theme. I like Revolution Slider more, and as the theme comes with the LayerSlider, I almost always disable it. Here is the code if you feel the same too.

 

Disable Portfolio Custom Post Type

All website don’t need a portfolio section. Similar to the case of LayerSlider, I don’t get to use it most of the time. So, I disable it to keep the dashboard clutter free of unnecessary features. Simply add the code below to turn off the portfolio custom post type on your website running with the Enfold Theme.

 

Deactivate Backlinks to Kriesi.at on Footer

Sorry Kriesi, but we can not always give credit to the original theme author on our projects (which I feel you deserve for your work).

So, if you use Enfold, you will surely notice that the footer contains “© Copyright – [Your Site Name] – Enfold WordPress Theme by Kriesi” on the footer socket area. To disable this, you add the following code

 

Enable Enfold’s Avia Layout Builder Debug

This is very useful when you want to use the code built with the layout builder and use it elsewhere, for example on a custom page template. Unlike Visual Composer plugin, the layout builder does not display the generated shortcode when you go back to the classic editor from the Advanced Layout Editor. However, you can do get the shortcodes easily using this snippet. Simply add the code given below to your functions.php file and check the bottom of the pages for the full shortcode generated by the layout builder. Learn more about this snippet here.

 

Breadcrumb filter for Custom Post Type

Customize the breadcrumb for custom post type archive template with the following code. You will need to change the according to your need. [source]

 

Modify Enfold Theme Post Excerpt Length

To increase the default length of post excerpt (mostly used on post slider, blog archive etc) you can use the following snippet. Increase or decrease the value to fit the need of your desired layout

 

Add Extra Google Fonts to Theme Options

The number of Google Fonts that are available (for use as heading and content area text) on the Theme Options panel is limited. However, you may add the ones you like using the snippet below.

Choose the font you like from Google Fonts website and change the code given below as per your choice of font.

 

Use the Magnific Popup Used on Enfold Theme

As Enfold already uses the Magnific Popup plugin for lightbox or modal effects on images and other elements, I think we should be using it too in case we need to get lightbox or modal effect. I use it for inline content, and it looks and works great. I have the codes divided into three sections below. First part is to be added to functions.php file and the CSS to style.css file or custom.css file as you like. The HTML portion of the code is to be added to the template file or page you are going to have the popup, modal or lightbox (whatever you want to call it).

 

Extra Footer Section Throughout the Site

It is a trend nowadays to have more than just footer widgets and copyright area. Things like newsletter subscription, call to action, client logos, sponsored links, etc makes its way to the bottom of the website on every page. It is an excellent way to present the essential part of the site to the visitor.

To have a section like that over the footer widgets section, on your website, use the following snippet. You may change the container and other bits to your need and can use any prebuilt layout from the theme. Here we are only hooking some code to an available hook defined in the footer section. You will find much more hooks throughout the theme. You can use “Simply Show Hooks” plugin from the WordPress plugin repository to easily find them.

 

Using Featured Image as Page Header with Title & Breadcrumb

We can make a page look pretty with a good header image. This can be done with the featured image. Without the featured image set, a normal page looks like this

It looks good but can be better. After adding a featured image to the page we can get the following look

However, I don’t find this look to be the best. Which is why I use the following look for most websites.

Many of you may say, that it is possible to get the look with the help of Avia Page Builder / Advanced Layout Builder. But I think, setting up Color Section, adding image etc is more work than just adding a featured image and getting a great look.

Faster WordPress Hosting
  • Alexandre Mabeix

    Hi Real,

    Great Post ! Thank you for these usefull snippets !! I’am also a great fan of Enfold !
    About “Deactivate Backlinks to Kriesi.at on Footer” you can also simply put this shortcode [nolink] in the copyright field => © Copyright – [Your Site Name] – [nolink]
    Cheers,
    Alex

    • Hello Alex, Glad you liked my post. Good to see other Enfold fans here! I used to use [nolink] but later included the function on the child theme (which I always use) so no longer had to include it on every site 🙂