WordPress Theme Development

  Home  Web Development  WordPress Theme Development


“WordPress Themes Development based Frequently Asked Questions by expert members with experience as WordPress Theme Developer. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



109 WordPress Theme Development Questions And Answers

5⟩ Explain what are the custom fields in wordpress?

We will add extra information to your post by using custom fields. Custom Fields are a form of meta-data that allows you to store arbitrary information with each WordPress post.

Meta-data is handled with key/value pairs. The key is the name of the meta-data element. The value is the information that will appear in the meta-data list on each individual post that the information is associated with.

To display the Custom Fields for each post, use the the_meta() template tag.

To fetch meta values use the get_post_meta() function.

For example we use custom fields:-

<?php echo get_post_meta($post->ID, ‘key’, true); ?>

 170 views

8⟩ Explain me do I need to know any programming to make updates?

To initially setup a site and customize it you will, though you don’t need to worry about that because that is what we are doing for you. Once the site is setup we will train you on how to perform the updates (very simple) and you will be good to go. In order to perform the content updates you may need in the future you will not need to know any programming at all. I compared it earlier to using Microsoft Word and it really is that easy!

Forget about having to hire a programmer to make simple text updates on your site from now on, you can go in and do it yourself in a matter of minutes.

 144 views

9⟩ Explain me why does WordPress use MySQL?

MySQL is widely available database server and is extremely fast. It is an open source and it is available at no cost also it is supported by many low-cost Linux hosts so its easy for anyone to host their website.

 147 views

11⟩ Explain me how to run database Query in WordPress?

The $wpdb->query function allows you to execute any SQL query on the WordPress database. It is best to use a more specific function. Check sample code below for SELECT query.

<?php $wpdb->query('query'); ?>// Examples

$wpdb->query( "

UPDATE $wpdb->posts

SET post_parent = 7

WHERE ID = 15

AND post_status = 'static' "

);

 171 views

13⟩ Explain me how to add option for open menu item in new tab?

This is very basic feature but sometime developer never use this so they have no idea and goto code and add manually that links.For add option in menu item for open link in new tab just navigate to “Screen Option” at top right corner in menu select check “link target”. See below screenshot.

 148 views

14⟩ Tell me how can I get WordPress working when I’m behind a reverse proxy?

In some setups, it’s necessary to use something other than the HTTP_HOST header to generate URLs. Reverse proxies take the original request and send it to one of a group of servers. To do so, it overwrites the HTTP_HOST with the internal server’s domain. When that domain is not publicly accessible, at best your images might not load correctly, at worst, you’ll be stuck in a redirect loop. To fix this, figure out which header has the right domain name and add a line to your wp-config.phpfile that overwrites HTTP_HOST with the correct hostname.

If you need to use SERVER_NAME, add this line to wp-config.php:

$_SERVER[‘HTTP_HOST’] = $_SERVER[‘SERVER_NAME’];

If you need to use HTTP_X_FORWARDED_HOST, add this line to wp-config.php:

$_SERVER[‘HTTP_HOST’] = $_SERVER[‘HTTP_X_FORWARDED_HOST’];

 169 views

19⟩ Tell me can I use a database other than MySQL?

Other databases are not supported at the moment.

There are several other excellent database storage engines, such as PostgreSQL and SQLite that WordPress is interested in supporting in the future. Supporting multiple databases is trickier than it sounds and is not under active development, although there are plenty of architectural discussions about the best approach to take. Approaches for increasing the number of supported databases are discussed at Using Alternative Databases. There is a PostgreSQL port of WordPress available called WordPress-Pg.

 168 views

20⟩ Tell me how do I disable trackbacks and pingbacks?

First, unchecked Allow link notifications from other Weblogs (pingbacks and trackbacks.) on the Options > Discussion panel. This will only disable trackbacks and pingbacks on future posts. Now, to completely disable trackbacks and pingbacks, you will have to edit each past post and uncheck Allow Pings from the Write Post SubPanel. Alternatively, run this MySQL query from the command line on a shell account or using PHPMyAdmin: UPDATE wp_posts SET ping_status=”closed”;

If your goal is to permanently disable trackbacks and pingbacks, then you should delete the wp-trackback.php file as well.

 150 views