Insert double entry in DB

Simple – if you do not want duplicate information then before you insert anything check if such data is already present. Just query for it and see if there is a match. From WP perspective however, you seem to be looking at technique (database table) that you will rarely need in practice. WordPress offers wealth … Read more

Media Playlist Plugin

Here’s a quick example showing how you would pass php data to your script. First, we hook our function to the wp_enqueue_scripts action. Inside, we enqueue the script that contains the player and initialization code (this is probably two separate files, but I’ve condensed it to a single file in this example). Next, we call … Read more

how to check for wordpress Query errors

A good pointer would be to enable debugging in WordPress. Add this to your wp-config.php: define( ‘WP_DEBUG’, true );. By default WordPress does not show much debug information. More on this here.

Sidebar current menu item for parent

I believe that it will be hard for you to accomplish that without some javascript because you are adding the link manually. However, you can achieve the same thing in another way: Most wordpress themes come with a body_class() function in the <body> tag. That function adds several classes to the body tag that allows … Read more

Rename Index.php

Just move your wordpress installation to a subdirectory and switch back after. See the WordPress Documentation.

Execute php in pages

If you have a page, and need to run PHP code that isn’t in your standard page template, you can: Use a custom page template Create a template with page-pagename.php Implement and use a shortcode All three are valid and suitable methods for doing this, however, do not: Try to let users place actual PHP … Read more