Where to add my PHP codes for AJAX Jquery to work?

Here is a general scenario for adding PHP code snippets in WordPress theme or plugin. Scenario 1: Theme is your custom made theme. In this case, you can add code snippets in your own desired way (and obviously in standard way since you are the author of the theme). Scenario 2: Theme is either premium … Read more

Cant get blog name with get_option

You need access to the property of $username to get the name $user = wp_get_current_user(); $username= $user->display_name; Get option method will return the name of the site you have set in setting -> general options $url = get_option( ‘blogname’); If you need home URL then $url = get_option( ‘home’ );