• Trusted by:

Hire WordPress developers and engineers

Petar Smolić, Croatia

Member since October 1, 2015
Petar has over 4 years of experience as a full-stack PHP developer. He mostly works with PHP frameworks and develops WordPress sites. He's an extremely fast learner, adaptable to new enviroments. Recently, he's started to switch his focus to Node.js. Click to continue

Benjamin Knight, United States

Member since November 13, 2014
Benjamin is a web designer and developer with experience across the web stack beginning in his early teens before web standards. He codes with an eye towards providing a quality user experience and interaction, and enjoys making creative decisions. He loves Python and JavaScript (the good parts) and has worked in a variety of environments, from a large engineering team to a smaller startup and independent freelance work. Click to continue

Christos Melas, Greece

Member since August 5, 2015
Christos is a full-stack software engineer and architect with over 12 years of work experience in programming. He has designed and implemented enterprise-scale distributed information systems with JEE architectures of multi-node application servers and web stack technologies for the front-end. His latest projects are publicly accessible scaling to hundreds of thousands of users. He is fond of innovation and researches cutting-edge technologies. Click to continue

Alan Heric, Croatia

Member since February 27, 2014
Alan is a talented developer with a proven ability to develop scalable, efficient, and bug-free web solutions. He is technically skilled, passionate about his work, and goal-oriented. Click to continue

Carlos Minatti, Argentina

Member since January 15, 2013
Carlos is fanatic about Internet and communication technologies and finding ways to help people solve daily problems. He has a host of experience building web and Android applications, and always aims to deliver the best possible user experience. Click to continue

André Gumieri de Freitas, Brazil

Member since March 24, 2016
André is a senior front-end web developer with 13 years of experience. During his career, he has worked with projects ranging from basic design all the way to large development efforts. As a professional, André is considered pixel perfect when it comes to UI and has great knowledge architecting web projects. Click to continue

Max Loginov, Russia

Member since February 23, 2016
Max is an experienced engineer with a scientific background and 19 years in development, QA, and management in IT. He has worked for a number of world-recognized companies and has proven himself to be a polymathic problem solver who always delivers high quality solutions that thoroughly address customer needs. His experience with various tech gives him the ability to quickly integrate into any project and work out the best solution possible! Click to continue

Jason Funk, United States

Member since June 12, 2015
Jason is an experienced web developer with a broad range of both professional and personal technical achievements. He is the founder of Tough Space Consulting, a cloud-based business software consulting company that has helped a number of clients become more efficient and save money by improving their internal business processes. Jason is a strong team player yet at the same time enjoys taking on personal challenges. Click to continue

Flavio Escobar, Brazil

Member since April 23, 2014
Flavio is a top developer and an aspiring entrepreneur. He has extensive experience and skills with web and game development, and is also proficient with mobile applications. He is a master of PHP, JavaScript, and ActionScript. Click to continue

Marcelo Mazza, Argentina

Member since April 14, 2015
Marcelo has been working for more than 10 years in User Experience (UX). He has solid knowledge of mobile platforms, UX, usability, design, front-end development, and WordPress, in addition to excellent interpersonal skills. He has proven experience in project management and strong organizational and planning skills, coordinating deliverables with prioritization of tasks according to the needs of each business. Click to continue
WordPress Resources
Trustpilot
Toptal on TV
"Toptal is killing it, it kind of owns this market."
Andrew Ross Sorkin Reviews Toptal
Cnbc 02e66b
"Tech companies simply cannot find the quality employees they want to hire. The solution: Toptal."
Liz Claman´s Review of Toptal
Fox 7ef901
Toptal in the press
“Despite accelerating demand for coders, Toptal prides itself on almost Ivy League-level vetting.”
Selina Wang
“Toptal allows corporations to quickly assemble teams that have the right skills for specific projects.”
Steven Norton
A hiring guide
The Vital Guide To WordPress Interviewing

Currently, WordPress is one of the most popular Content Management Systems. Clients love it because it’s easy to set up, there are a variety of plugins, and it has a user-friendly approach. Developers like it because of its understandable functionality, which means it’s easy enough to set up yet still gives decent quality. As a result, the number of sites using WordPress is growing, and it’s becoming more important than ever to be able to separate great WordPress developers from the rest of the pack. In this WordPress Hiring Guide, we cover the most important questions and answers that will help you determine whether your candidates are suitable for your hiring needs.

Testimonials
“Toptal makes finding a candidate extremely easy and gives you peace-of-mind that they have the skills to deliver. I would definitely recommend their services to anyone looking for highly-skilled developers.”
Michael Gluckman
Data Manager @ Mxit
“Toptal's developers and architects have been both very professional and easy to work with. The solution they produced was fairly priced and top quality, reducing our time to launch. Thanks again, Toptal.”
Jeremy Wessels
CEO @ Kognosi
“Working with Enrique has been a pleasure and a relief. His knowledge in the IT space is broad and in-depth. Zoomedia has been in need of this level of support for some time and I feel confident we are an exponentially stronger team with Enrique on board.”
Justin Bane
Senior Technical Lead @ Zoomedia
“We struggled for weeks to find a developer or architect with expertise in a niche API, but to no avail. When we linked up with Toptal, they connected us with the very expert we needed, and a week later we were hard at work making progress! The whole process was very smooth and we ended up with a new feature we couldn't have done without Toptal.”
Thomas Honeyman
COO @ FindMySong
“Dave as a developer was absolutely fantastic! The guidance that he provided us will allow us to make tremendous improvements to the next version of our application.”
Baroni Parson
IT Manager @ City Real Estate Advisors, Inc.
“I'm incredibly impressed with the caliber of the Toptal developers I have worked with - they have proven themselves to be both dedicated and highly talented. We will most definitely continue to work with Toptal. ”
Savannah de Savary
Founder @ Industry Hub
“We needed some short-term work in Scala, and Toptal found us a great developer within 24 hours. It was done quickly for a specific need, and it's been great. It simply would not have been possible via any other platform.”
Franco Arda
Co-Founder @ WhatAdsWork.com
“Our Toptal contractor quickly came up to speed on our process and became an integrated part of our team. We look forward to growing together!”
Vitaly M. Golomb
CEO @ Keen Systems
“Working with Toptal has been a great experience. Prior to using them, I had spent quite some time interviewing other freelancers and wasn't finding what I needed. After engaging with Toptal, they matched me up with the perfect developer in a matter of days. Amaury, the developer I'm working with, had all of the right skills and experiences that I needed for my project. He not only delivers quality code, but he also makes suggestions on things that I hadn't thought of. It's clear to me that Amaury knows what he is doing and I'm happy to have him on the team. Highly recommended!”
George Cheng
CEO @ Bulavard, Inc.
“We had a great experience with Toptal. They paired us with the perfect developer for our application and made the process very easy. It was also easy to extend beyond the initial time frame, and we were able to keep the same contractor devoted to the project. We definitely recommend Toptal for finding high quality talent quickly and seamlessly.”
Ryan Morrissey
CTO @ Applied Business Technologies, LLC
“Toptal helped us when we had a hiring gap we needed to fill. The developer we received was excellent, with a great work ethic and fit in very well with the team. We are very happy with the service and would definitely consider using Toptal again in future should we need additional help. ”
David Gildeh
CEO @ Dataloop.io
“I struggled for weeks with a Youtube API-specific problem and couldn't find anyone to solve it. Toptal immediately identified the right consultant who took the time to investigate the issue and resolve it quickly. The process was seamless and I will continue to use Toptal with any other issues that arise.”
Rohit Gupta
CEO @ Bollyshake
“One of our biggest and most time consuming problems is finding qualified staff. We need to find the correct platform to advertise on, create a proper ad, filter through tons of useless applications to try and find the small gems, interview and test the capabilities of applicants to see if they fit our profile and finally take a risk by hiring. This was the old way of doing things! The new way: describe the job position to our Toptal account manager, interview a few qualified applicants, hire with a risk-free trial! Much faster, a lot easier and with incredible end results.”
Catalin S. Balaci
Owner @ EvoBits Information Technology SRL
“The task of finding and hiring the right developers and programmers can be daunting, especially for startups. After sifting through countless unfit freelancers, we came across Toptal. They were able to fill our open position in no time, and I'd highly recommend the service!”
Josef Holm
CEO @ Tubestart
“Robert was such a breath of fresh air! I’m used to working with developers who don’t speak good English, don’t understand my needs, and are bad communicators in general. But Robert was not only an EXCELLENT communicator, he knew exactly what I was looking for and made it better than I thought possible. Now I have a website that works better than I thought it could for less than the cost it would have taken other developers, and in half the time. Robert is as good as they come, and a true professional. Anyone thinking of working with him, stop thinking about it and hire him. You won’t regret it.”
Matthew Bennett
CEO @ Winning Social
Hire a top WordPress developer now.
Toptal is a marketplace for top WordPress developers, engineers, programmers, coders, architects, and consultants. Top companies and start-ups choose Toptal freelancers for their mission critical software projects.
Full
profile
Petar SmolićCroatia
Petar has over 4 years of experience as a full-stack PHP developer. He mostly works with PHP frameworks and develops WordPress sites. He's an extremely fast learner, adaptable to new enviroments. Recently, he's started to switch his focus to Node.js.
[click to continue…]
WordPressJavaScriptPHPHTML5GitMySQL
Hire
Full
profile
Benjamin KnightUnited States
Benjamin is a web designer and developer with experience across the web stack beginning in his early teens before web standards. He codes with an eye towards providing a quality user experience and interaction, and enjoys making creative decisions. He loves Python and JavaScript (the good parts) and has worked in a variety of environments, from a large engineering team to a smaller startup and independent freelance work.
[click to continue…]
WordPressHTML5CSSPHPPythonJavaScriptjQueryResponsive Web Design
Hire
Full
profile
Christos MelasGreece
Christos is a full-stack software engineer and architect with over 12 years of work experience in programming. He has designed and implemented enterprise-scale distributed information systems with JEE architectures of multi-node application servers and web stack technologies for the front-end. His latest projects are publicly accessible scaling to hundreds of thousands of users. He is fond of innovation and researches cutting-edge technologies.
[click to continue…]
WordPressJavaScriptJavaCSSEmber.jsjQuery
Hire
Full
profile
Alan HericCroatia
Alan is a talented developer with a proven ability to develop scalable, efficient, and bug-free web solutions. He is technically skilled, passionate about his work, and goal-oriented.
[click to continue…]
WordPressCSS3HTML5CSSjQueryAdobe DreamweaverAdobe PhotoshopMac OS XWindows 7
Hire
Full
profile
Carlos MinattiArgentina
Carlos is fanatic about Internet and communication technologies and finding ways to help people solve daily problems. He has a host of experience building web and Android applications, and always aims to deliver the best possible user experience.
[click to continue…]
WordPressSQLPHPJavaScriptjQueryGitMySQL
Hire
Full
profile
André Gumieri de FreitasBrazil
André is a senior front-end web developer with 13 years of experience. During his career, he has worked with projects ranging from basic design all the way to large development efforts. As a professional, André is considered pixel perfect when it comes to UI and has great knowledge architecting web projects.
[click to continue…]
WordPressCSS3JavaScriptHTML5CSSAPIjQueryGitFront-endCSS3 Animation
Hire
Full
profile
Max LoginovRussia
Max is an experienced engineer with a scientific background and 19 years in development, QA, and management in IT. He has worked for a number of world-recognized companies and has proven himself to be a polymathic problem solver who always delivers high quality solutions that thoroughly address customer needs. His experience with various tech gives him the ability to quickly integrate into any project and work out the best solution possible!
[click to continue…]
WordPressPHPJavaJavaScriptSQLC/C++React.jsNode.jsjQueryMySQL
Hire
Full
profile
Jason FunkUnited States
Jason is an experienced web developer with a broad range of both professional and personal technical achievements. He is the founder of Tough Space Consulting, a cloud-based business software consulting company that has helped a number of clients become more efficient and save money by improving their internal business processes. Jason is a strong team player yet at the same time enjoys taking on personal challenges.
[click to continue…]
WordPressPHPSQLJavaScriptMySQL
Hire
Full
profile
Flavio EscobarBrazil
Flavio is a top developer and an aspiring entrepreneur. He has extensive experience and skills with web and game development, and is also proficient with mobile applications. He is a master of PHP, JavaScript, and ActionScript.
[click to continue…]
WordPressCSSCSS3JavaScriptSQL-99PHPSQLjQueryMySQL WorkbenchAdobe Flash BuilderjQuery File UploadWindows 7MySQL
Hire
Full
profile
Marcelo MazzaArgentina
Marcelo has been working for more than 10 years in User Experience (UX). He has solid knowledge of mobile platforms, UX, usability, design, front-end development, and WordPress, in addition to excellent interpersonal skills. He has proven experience in project management and strong organizational and planning skills, coordinating deliverables with prioritization of tasks according to the needs of each business.
[click to continue…]
WordPressCSSTwitter BootstrapUser Interface DesignUser Experience (UX)
Hire

The Vital Guide To WordPress Interviewing

The Challenge

Currently, WordPress is one of the most popular Content Management Systems (CMS). It may be used to create a personal blog, internet shop, landing page, corporate website and more. Clients love it because it’s easy to set up, there are a variety of plugins and, overall, it has a user-friendly approach. Developers like it because of its understandable functionality, which means it’s easy enough to set up yet still gives you decent quality.

The number of sites using WordPress is growing, which is creating a demand for a significant number of WordPress developers. So, how do we distinguish a novice from an experienced WordPress developer? In this guide, we suggest questions and answers that will help you determine the level of skills your candidate has.

Why spend money and time building website from scratch, when you can hire top WordPress developer and save?

Why spend money and time building a website from scratch, when you can hire top WordPress developer and save?

Questions and Answers

Q: Discuss how to setup a custom theme, name the minimum required files, and explain how WordPress recognizes a new theme.

Every WordPress site requires a theme; it is how it is structured and is therefore an integral part of the site.

The new theme is created as follows: In the wp-content/themes/ directory, create and name a new folder. Best practice is to use the name of the company for which you are making the website. Use lower case (Roman alphabet) without spaces. Note that you need to put in the theme folder these five files: style.css, functions.php, index.php, header.php and footer.php. Later, you can extend the theme with other custom files.

The formation of the style.css file header is a part of the base theme settings. With the help of file style.css and headers in it, WordPress’s core will recognize your folder as the new theme.

The beginning of the style.css should be as follows:

/*
Theme Name: [theme name]
Author: [author name]
Author URI: [author URL]
Version: [theme version]
Description: [theme description]
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

If you create a child theme, you need to add another line where the base theme is indicated.

Template: twentyfifteen

Where twentyfifteen is the name of the main (parent) folder theme.

Q: Explain how WordPress generates a page.

WordPress recognizes and analyzes the request entered in the URL bar, picks the best PHP file, and generates the webpage. It makes a global object $wp_query based on the request in the URL. Then, with the help of its functions, WordPress loads other files, such as header.php, footer.php, and sidebar.php.

Check the template hierarchy scheme, which defines the process and file that will output the content of the current query.

For example, if the address is /? Cat = 1, WordPress will first look for category-slug.php file. If the file is not found, it will search the category-id.php file. If this can’t be found, either, it looks for the file category.php, and so on, until it finds the appropriate file. If it can’t find one, it simply selects the index.php file.

Q: Explain the semantics of a theme’s development and the basic principles of a good theme. What should be kept in the theme files?

Here are some of WordPress’s best practices and recommended principles for creating a new theme:

  • The function wp_head() must be in the header.php file.
  • The function that operates classes, must be in the header.php file, inside the body tag: <body <php body_class ();? ? >>
  • The function wp_footer() must be in the footer.php file.
  • If you have a repeating functionality, this code must be put into separate function, and this function must be added to the functions.php file.
  • In all files, except header.php and the footer.php, the number of opening HTML tags must be equal to the number of closing tags.
  • If the file contains duplicate pieces of HTML code, it is better to unite them in a single file, put it in a theme subfolder, which can be named blocks or whatever you need, connect this piece of code, and call the function get_template_part( 'blocks/[name-of-the-file.php]' );.
  • File index.php is the final file to process the request, so it needs to have the main loop minus any queries. That means it will be impossible to alter the main loop in index.php.
  • All the theme settings must be in the functions.php file: actions, filters, custom functions, and custom classes. Although classes and functions may be located in different files, and be connected to the main functions.php, or be placed in a separate plugin.
  • The code should not contain commented code. Commenting as a description is allowed, but code chunks that have been used in the design, should be removed.
  • Code in the files should be structured with the aid of indents.
  • Themes must be validated by the w3c standards.
  • The theme should work without exterior plug-ins. For example, if we use the WP-PageNavi plugin, you must write:
if (function_exists ( 'wp_pagenavi')):
    wp_pagenavi ();
else:
    get_template_part ( 'blocks / pager');
endif;
  • If the code uses functions or plugins classes, make sure the function or class exists:
if (function_exists ('name_of_the_function'))
  • For direct requests to the database, you must use the class $wpdb and its methods.
  • If you use the form and need to create an options page admin panel, you must use wp_nonce_field(), and on the server side check this field and action:
<?php

if ( ! isset( $_POST['name_of_nonce_field'] ) || ! wp_verify_nonce( $_POST['name_of_nonce_field'], 'name_of_my_action' ) 
) {
   print 'Sorry, your nonce did not verify.';
   exit;
} else {

   // process form data
}
?>

/* some code is here*/

<form method="post">
   <!-- some inputs here ... -->
   <?php wp_nonce_field( 'name_of_my_action', 'name_of_nonce_field' ); ?>
</form>
  • If some files are not used, remove them from theme folder. If a client doesn’t need to use “search” on his site, remove searchform.php from the theme folder.
  • Functions that begin with the _ must only be written in the loop. And in the loop, if possible, use the functions started with the _ for presenting display fields.

Q: Explain how to create a custom page template.

For custom page templates, it is better to create a separate folder; do not mix custom templates with existing WordPress templates. Place the custom template file into this folder. At the beginning of the file you need to add the following code:

<? Php
/ *
Template Name: [Template_Name]
* /
get_header (); ?>

Q: Explain how to include your CSS and JavaScript files into the theme or plugin correctly.

You can use <link> or <script>, but the correct way is to connect them in the functions.php file. You need to add action to wp_enqueue_scripts, and our action is to connect JavaScript and CSS files:

function theme_scripts_styles () {
    // Connection of a custom JS file after jquery library that will be  connected independently by WordPress
    wp_enqueue_script ( 'theme-script', get_template_directory_uri () '/js/jquery.main.js', array ( 'jquery').);
 
    // Loads default theme style.css.
    wp_enqueue_style ( 'theme-style', get_stylesheet_uri (), array ());
    
    // Connection of a custom css file
    wp_enqueue_style (. 'theme-theme', get_template_directory_uri () '/theme.css', array ());
}
add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' );

Q: Explain how you make a custom menu and how you display that menu on the page.

To display the menu, you must:

  • Select the location for ther menu in the functions.php:
register_nav_menus (array (
 	'Primary' => __ ( 'Primary Navigation'),
));
  • Use this location to display a menu:
if (has_nav_menu ( 'primary'))
 	wp_nav_menu (array (
	...
	'Theme_location' => 'primary',
	...
	)
 	);

Menus are placed on a page via the admin panel, which also allows other pages to have menus (with the same look) placed in the same location.

Custom settings can be made through parameters wp_nav_menu() function, but should you need to create a custom menu, do this:

  1. Create inheritance class from Walker_Nav_Menu, where you can write your custom functionality: class Custom_Walker_Nav_Menu extends Walker_Nav_Menu {...}.
  2. When displaying the menu, add another parameter walker:
if( has_nav_menu( 'primary' ) )
	wp_nav_menu( array(
        	 ...
        	 'theme_location' => 'primary',
        	 'walker'       	=> new Custom_Walker_Nav_Menu
        	 ...
        	 )
	);

Q: Explain what a loop is and how it works.

Loop means “cycle” from which WordPress generates the page content. If there is a single page, for example, page.php or single.php, the cycle remains with the template, but it will be realized only once. If you have search.php, archive.php or the index.php, the cycle will take place as many times as necessary to satisfy the request, which depends on the query URL, and consequently, on how the object is formed wp_query. Loop runs for posts in the global $wp_query object.

Q: Explain the difference between functions that begin with the_ and other functions.

Functions starting with the_ are intended to be used in the loop. Note they can’t be used out of the cycle.

Q: Explain custom post types; why do we use them, and how can we create them?

Custom post types are needed to break content logically. For example, we want to list all the sales managers in a company, so that customers may contact them directly from our website. Say, we have about 20 people in the sales department, and at any time, one of them might quit or someone new might join. So, for this task, the most logical action is to create the post type Team and in the template list everybody who is in the post type Team.

A simple example of the creation of a custom post type:

add_action( 'init', 'theme_create_post_type' );
function theme_create_post_type()
{
        	register_post_type( 'team',
	    	array(
        	        	'labels' => array(
                            		'name' => __( 'Team' ),
                            		'singular_name' => __( 'team' ),
                        	    	),
        	        	'publicly_queryable' => true,
        	        	'public' => true,
'show_ui' => true,
        	        	'hierarchical' => false,
        	        	'menu_position' => null,
        	        	'query_var' => true,
        	        	'supports' => array('title','editor','thumbnail','custom-fields','comments')
    		)
        	);
}

Custom post types are created at the action init. Therefore, you need to create action and name it register_post_type() in function with the desired set of parameters.

Q: Explain how to get posts from custom post type and custom taxonomy.

For example, we have a post type Team and taxonomy Department, and in custom taxonomy, we have the term Managers. Our task is to display all the managers.

Provided the “slug” of the term Managers in custom taxonomy Department is equal to Managers, we can utilize WP_Query class, like this:

$args = array(
        	'post_type' => 'team',
        	'tax_query' => array(
                    	array(
                                	'taxonomy' => 'department',
                                	'field'	=> 'slug',
                                	'terms'	=> 'managers',
                    	),
        	),
);
$query = new WP_Query( $args );

Q: Explain shortcodes and provide few examples.

Shortcodes are keywords used to create macros that can be used later in a post’s content. In WordPress, they are enclosed in square brackets []. Shortcodes can be used either in the content editor’s post or in a pattern, if you apply do_shortcode() function. The simplest example is when a client does not know HTML, but it is necessary to insert something in the content of the posts.

In WordPress, we can create three types of shortcodes. However, because they can be configured in different ways, shortcodes have unlimited possibilities. It is important to note that the shortcode processing function must return the value, not display it. For example, if we need to display the phrase “Hello World”, we would write in functions.php something like the following:

function hworld_func( $atts ){
        	return ‘<div class=”block-wrapper”><div class=”block”>Hello world</div></div>’;
}
add_shortcode( 'hworld', 'hworld_func' );

To get the shortcode to work, we need to insert [hworld] into the post content.

If we have to adjust the shortcode from the admin panel, we can add parameters to it, like this: [hworld cssclass = "red"].

A code in the functions.php will be as follows:

function hworld_func( $atts ){
        	return ‘<div class=”block-wrapper ’ . $atts[‘cssclass’] . ’”><div class=”block”>Hello world</div></div>’;
}
add_shortcode( 'hworld', 'hworld_func' );

Also, as well as the parameters, we can handle the text itself. To do that, the shortcode should look like this: [hworld cssclass = "red"] Hello world [/ hworld].

The functions.php will then look like this:

function hworld_func( $atts, $content ){
        	return ‘<div class=”block-wrapper ’ . $atts[‘cssclass’] . ’”><div class=”block”>’ . $content . ’</div></div>’;
}
add_shortcode( 'hworld', 'hworld_func' );

Q: Describe how to make a widget. Explain primary widget functions.

In WordPress, you can create custom widgets by creating a class that inherits basic functions from WP_Widget class.

The primary functions of the widget class:

  • __construct(): Constructor of the widget, it will add a widget to the admin panel.
  • widget($ args, $ instance): Displays the content on the front-end based on the function arguments. $ args are widget arguments which are set in the sidebar to wrap a widget. $ instance are parameters of the widget, which can be configured in the admin area.
  • update($ new_instance, $ old_instance): A feature that saves the new widget options, if they have been changed by the administrator in the admin panel.
  • form($ instance): Creates a widget settings form in the admin panel on the page widgets.php.

The final thing to make the widget work is on the action widgets_init attach function that will record (register) it:

add_action ( 'widgets_init', create_function ( '', 'return register_widget ( "CustomWidget");'));

Widget example:

class CustomWidget extends WP_Widget {
 
	function __construct() { ... }
 
	function widget( $args, $instance ) { ... }
 
	function update( $new_instance, $old_instance ) { ... }
 
	function form( $instance ) { ... }
}
add_action( 'widgets_init', create_function( '', 'return register_widget( "CustomWidget" );' ) );

Q: Explain what actions and filters are. Discuss their differences, and how and when to use them.

You can not change WordPress core files and plugins. However, sometimes we need to change default core behavior, which is when actions and filters come to the rescue.

They work almost identically, the only difference is that functions that are imposed on the filters return a value, while actions do not. So, filters change some content or meaning, which would later be used by the core or plugin.

Here’s an example of a filter that must be written in the functions.php:

add_filter(‘the_content’, ‘theme_the_content’);
function theme_the_content($content){
        	return ‘<div class=”contentwrap”>’ . $content . ‘</div>’;
}

This means that somewhere in the core code or plugin there is a line similar to this:

$content = apply_fintens(‘the_content’, $content);

So, the variable $content is the second parameter that’s sent to theme_the_content() function. It may also look like the following code:

$var = apply_filters(‘some_filter_name’, $var1, $var2, $var2);

In this case, you need to write in functions.php:

add_filter(‘some_filter_name’, ‘theme_some_filter_name’, 10, 3);
function theme_the_content($var1, $var2, $var2){
        	return [SOME_CODE];
}

In the filter function, number 10 can be any integer that indicates the priority of this filter, if such filters will be several, and number 3 is a number of variables that come into function.

add_action( 'init', 'theme_create_post_type' );
function theme_create_post_type()
{
        	register_post_type( 'team',
	    	array(
        	        	'labels' => array(
                            		'name' => __( 'Team' ),
                            		'singular_name' => __( 'team' ),
                        	    	),
        	        	'publicly_queryable' => true,
        	        	'public' => true,
        	        	'show_ui' => true,
        	        	'hierarchical' => false,
        	        	'menu_position' => null,
        	        	'query_var' => true,
        	        	'supports' => array('title','editor','thumbnail','custom-fields','comments')
    		)
        	);
}

Parameters may be passed to both actions and filters. If we do not need the filter or action, we can remove it. For example:

remove_filter ( 'some_filter_name', 'theme_some_filter_name', 10);
remove_action ( 'init', 'theme_create_post_type');

Q: Discuss different ways of integrating plugins into a theme. Explain correct ways of doing it.

Plugins can be integrated in many ways:

  • Through actions and filters.
  • Through shortcodes.
  • Through widgets.
  • Through a PHP function.

If the plugin is integrated with the aid of PHP code, you should check for the existence of a function:

<?php if(function_exists('bcn_display')) bcn_display(); ?>

It is important to check the theme’s ability to work without plugins, so that when the plugin is deactivated the theme will keep working. For example, if we use the plugin WP_PageNavi, we should write code like this:

if(function_exists('wp_pagenavi')):
	    	wp_pagenavi();
else:
	    	get_template_part( 'blocks/pager' );
endif;

That means when you turn off the plugin, the theme will continue to operate while maintaining a functional page. However, it will be a standard page, not one that would show with the use of the plugin.

Q: Describe the steps to create a simple plugin.

The plugin is an addition; it is an expansion of WordPress’s functionality. To create a plugin, you first need to create a folder in the wp-content/plugins directory, using lower case, Roman alphabet, and no spaces. Inside this folder, you need to create a file with the same name as the folder using the extension .php. This will be the main file. Additionally, create an empty index.php file to hide the list of files and catalogs.

At the beginning of the main file, add predefined meta data lines through which WordPress understands that it is a plugin:

<?php
/*
Plugin Name: [PLUGIN NAME]
Description: [PLUGIN NAME DESCRIPTION]
Version: [PLUGIN VERSION]
Author: [PLUGIN AUTHOR]
Author URI: [PLUGIN URL]
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

Designing (creating) plugins with classes is recommended. So, an example of a plugin’s code structure might be like this:

<?php
/*
Plugin Name: TestPlugin_Name
Description: TestPlugin_Name description.
Version: 1.0.0
Author: evgen@toptal.com
Author URI: https://www.linkedin.com/in/evgengavrilov
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
class TestPlugin {
	
	[CODE IS HERE]
	
        	function TestPlugin(){
        	 [CODE IS HERE]
        	}
	
        	[CODE IS HERE]
 
}
$testplugin = new TestPlugin();

Remember the rules of creating a theme: Media may only connect through action wp_enqueue_scripts, and the plugin must not contain any errors.

Q: Explain the role of child themes. How do you make a basic child theme?

Child themes are necessary when you need to change styles and functions of the main, or parent, theme but without changing its code. It’s like Object Oriented Programming: a class and its derived class. The inheritance does not break the parent, but it can change existing methods and add new ones.

A child theme may be created quickly and easily in a few steps:

  1. Create a folder inside the wp-content/themes with the name [name-of-parents-folders-theme]-child.
  2. Inside the folder, create styles.css file and to the main header file, add another line: Template: [name-of-parents-folders-theme].
  3. Create a functions.php file.

Thus, we can alter the styles of the parent theme by adding to our child folder template files. WordPress will use these files, and, if necessary, other files will be used from the parent theme folder.

Q: Explain a WordPress network, and how to create one.

WordPress network is a way of managing multiple sites through a single admin panel. The main difference in roles of Administrator and Super Administrator is that the Super Administrator can manage the network (Multisite).

The network can be made on any WordPress website. Although this functionality is integrated, by default, it is not activated.

To create a network:

  1. At the end of the wp-config.php file, write a line: define ( 'WP_ALLOW_MULTISITE', true);
  2. Refresh the Admin panel, and Subparagraph “Network Setup” should appear in the Tools menu. Click on it and go to the installation page. Fill in the fields created by WordPress.
  3. Next, you will be transferred to the page settings that should be copied to wp-config.php and .htaccess files. Simply copy the suggested code, and paste it into the appropriate file.
  4. When the files are changed, remember to logout of the Admin panel to allow a user to create and manage the network’s websites.

Conclusion

We hope you find the questions and answers in this post to be a useful foundation as you search for great candidates among the few elite WordPress developers. Finding such candidates is well worth the effort, as they will undoubtedly have a significant, positive impact on your team’s productivity.

Hire WordPress developers now
Alvaro 1506e7

My team is going to personally help you find the best candidate to join your team.

Alvaro Oliveira
VP of Talent Operations