<?php
have_posts(); // Check if have posts or use for looping posts
the_post(); // Function call for each post inside a loop
the_title(); // Post Title
the_content(); // Post Content
get_custom_logo(); // Outputs an image element with logo coming from wordpress backend (Site Logo)
get_template_directory_uri();// Outputs the current theme folder
wp_nav_menu($args); // Outputs the menu from wordpress backend with an array argument (refer to wordpress docs)
new WP_Query($args); // Query for customizing posts' output (must be assigned to a variable to be used as an object, refer to wordpress docs for arguments)
get_bloginfo(); // Outputs sites' information (refer to wordpress docs for arguments, if no argument was given, site title will be the default output)
get_search_query(); //Outputs search query
get_the_post_thumbnail_url(); // Outputs image path
the_post_thumbnail(); // Outputs the image
//Snippet for adding active class for wp_nav_menu, just insert in functions.php
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class ($classes, $item) {
if (in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
?>