WordPress Interview Questions & Answers – Part4

31. What are meta tags.
Meta tags keywords and description are used to display information about website or page.The commonly used meta tags are:-

<meta name="resource-type" content="document" />
<meta http-equiv="content-type" content="text/html; charset=US-ASCII" />
<meta http-equiv="content-language" content="en-us" />
<meta name="author" content="siddharth" />
<meta name="contact" content="" />
<meta name="copyright" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />

32. Can WordPress use cookies.
Yes, wordpress use cookies. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users.

33.  How come the code <?php print Contents: $arr[1]; ?> works, but <?php print Contents: $arr[1][2]; ?> doesnt for two-dimensional array of mine?
Any time you have an array with more than one dimension, complex parsing syntax is required. print “Contents: {$arr[1][2]}” would’ve worked. />

34. If we are hacked in wordpress but steps have to do for prevent it?
The various steps have to do when you hacked:-
1. Change passwords for all users, especially Administrators and Editors.
2. Re-install the latest version of WordPress.
3. Make sure all of your plugins and themes are up-to-date.
4. Install security plugins like wp security for safe from hacked.

35. Tell me Would you initialize your strings with single quotes or double quotes?
Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.

36. What is the wordpress loop?
The Loop are php code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page.

For example:-

if ( have_posts() ) {
while ( have_posts() ) {
// Post Content here
} // end while
} // end if

37.  Do you know Why doesnt the following code print the newline properly?

$str = ‘Hello, there.nHow are you?nThanks for visiting Us’;
print $str;

Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters – and n.

38. What is the special meaning of _sleep and _wakeup?
_sleeps return the array of all variables than need to be saved, while _wakeup retrives them.

39. How to call a constructor for a parent class?

40. How to disable wordpress comment?
Look in to dashboard under Options – Discussion. There is a checkbox there for “allow people to post comments on the article” Try unchecking that.
Also – you can do it in the box on the right in the Write screen. That only affects the one post, though.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

Your email address will not be published. Required fields are marked *

× nine = 9

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter