Laravel & Php

WordPress Quick Tips


WordPress Quick Tips

Most common wordpress functions

How to load WordPress template directory, WordPress home link, WordPress get author id by post, WordPress get author meta i.e display name

<?php
 
// wp home link
echo get_home_url(); 

//How to load wordpress template directory
echo get_template_directory_uri();
// or
bloginfo('template_url');

//get author id by post
get_post_field( 'post_author', get_the_ID());

//get author meta i.e display name
get_the_author_meta( 'display_name', $authorID );

?>

WordPress
Share with Friends

Like this chef? Share with friends..