Magento Engineer
social
Journal

Wordpress interview important question and answers.

Question1- What are the template tags in WordPress?

Answer. A template tag is code that instructs WordPress to “do” or “get” something. Like in header.php  we will use the tag bloginfo(‘name’) to get “Site Title” from wp-options table which is set in Setting > General at WordPress dashboard.

The the_title() template tag is used to display the post title.

wp_list_cats() is  for display categories.

get_header() for getting header.

get_sidebar() for display the sidebar on page.

get_footer() for get the footer content on page.


Question2- What do next_posts_link() and previous_posts_link() do?

Answer. Because post queries are usually sorted in reverse chronological order, next_posts_link() usually points to older entries (toward the end of the set) and previous_posts_link() usually points to newer entries (toward the beginning of the set).

Question3- How to retrieve an image attachment’s alt text?

Answer. The wp_get_attachment_image() function which will return an HTML string containing these attributes:

    1.src
    2.class
    3.alt
    4.title

Ad comes here
Comments
Leave A Comment
PHP blog
Update Cookies Preferences