Create a Blog Template Page

Why reinvent the wheel? Just create archive-{posttype}.php, and ensure that ‘has_archive’ is set to true for the post type. If your post type is event: archive-event.php. Then, WordPress will handle the query automatically. If pretty permalinks are enabled: example.com/{posttype} …will display the archive index page for {posttype}.

How to show a users bio on a page

WordPress already comes with the author page/functionality. Let’s say you have the author john on your site www.example.com, then you’d see his author page at www.example.com/author/john. If you want to customize this, you have to tweak (or maybe even create, depending on your theme) the author.php or other author template files.

How to edit php code in WordPress Post file?

You should never ever modify WordPress Core files. WordPress has an Plugin API (http://codex.wordpress.org/Plugin_API) that allows you to modify WordPress to your liking without changing Core code. In your case, the solution is to check the contents of the custom meta box fields before they are saved via the save_post action. If the content is … Read more

Saving zero in meta box

Your issue seems to be with too loose logic check, rather than saving. To treat valid but falsy value correctly you need something like this: if ( false !== $meta_value ) This will strictly match only the case when value doesn’t contain false (return of the API when fetch failed).

AJAX – Returning Two JSON Objects with One PHP Function

If I get it correctly, You need to wrap them in an array and pass to Javascript. function get_ldap_attr() { header(“Content-type: application/json”); … // suppose you want to return $second_var echo json_encode(array($sup,$second_var)); die(); } Success function of JSON request will receive them as array. You can access them with integer index. jQuery(function() { jQuery(‘#empLanId’).on(‘blur’, function() … Read more

How can i display a jquery slide on front page

As Jerome mentioned in his comment, including your own version of jQuery via a script tag is wrong. Nextgen adds the WordPress supplied version correctly via wp_enqueue_script, which creates the conflict. Remove the inclusion of jQuery via script tag. Properly enqueue your other javascript files with jQuery as a dependency. Fix your jQuery code to … Read more

Admin ToolBar not being displayed at top of site

It sounds like your theme does not use wp_footer() the way it should. That function should occur right before the closing </body> tag. The admin bar runs on a hook fired by that function. Without it, I get exactly what you describe. For reference, in Twenty Thirteen, it looks like this: http://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentythirteen/footer.php