Useful wordpress functions list Must Know Updated 2022

    By: Manu
    3 years ago

    Here is the list of Important wordpress Functions, these functions are used in almost our areas of wordpress app development, You can bookmark this list for future use.

    // Includes header.php
    
    get_header()
    
    // Includes footer.php
    
    get_footer()
    
    // checks if posts present
    
    have_posts()
    
    // displays title
    
    the_title()
    
    // Display some content using excerpt
    
    the_excerpt()
    
    // displays content
    
    the_content()
    
    // Check if is front page
    
    is_front_page()
    
    // checks which page
    
    is_page(pass page id or page slug here) 
    
    // Used in links (Makes title a link by getting url) 
    
    the_permalink()
    
    // For navigation link display
    
    wp_nav_menu()
    
    // Gets home page url
    
    home_url()
    
    // gets site name and description
    
    bloginfo('name')
    bloginfo('description')
    
    // Gets pages list
    
    wp_list_pages()
    
    // Get title from post id
    
    get_the_title(pass post id here)
    
    // Get permalink using page id
    
    get_the_permalink( id goes here)
    
    // Get the time 
    
    the_time('d/m/y')
    
    // Get the post author name in loop
    
    the_author()
    
    // Get the author posts url in loop
    
    get_author_posts_url(pass author id here)
    
    // Get author id in loop
    
    get_the_author_meta('ID')
    
    // Get categories array
    
    get_the_category()
    
    // get category link for making link in loop
    
    get_category_link(pass category id here)
    
    // check if is category archive, on archive page using this function
    
    is_category()
    
    // check if is tag archive, on archive page using this function
    
    is_tag()
    
    // check if is author archive, on archive page using this function
    
    is_author()
    
    // check if is day archive, on archive page using this function
    
    is_day()
    
    // check if is month archive, on archive page using this function
    
    is_month()
    
    // check if is year archive, on archive page using this function
    
    is_year()
    
    // Check if post has thumbvnail
    
    has_post_thumbnail();
    
    //Show user search term they entered on search.php using
    
    the_search_query()