Autocomplete or suggest from post titles inside plugin

In order to properly enqueue a script you must use the wp_enqueue_script like this : wp_enqueue_script( ‘suggest’, get_template_directory_uri() . ‘/js/path/to/suggest.js’, array(‘jquery’), ‘1.0.0’, true ); The second parameter is the path to your JavaScript file, the third parameter is the dependencies the script relies on (since suggest is a jquery plugin, it must be loaded after … Read more

Use wordpress plugin in codeigniter

It is possible but probably not worth it. what you will need to do is bootstrap wordpress by including the wp-load.php file located at the root of the wordpress directory structure. The problem is that wordpress is still far from having a clean organized code which is globals free so while it is possible in … Read more

Strange ASCII characters overlapping content

It seems that error is in your theme.min.css. The Font Awesome Icon which should appear in the browser is added via CSS using content. But the CSS does not contain the icon information but these weird looking characters. For Example: .fa-music:before{content:”ï��”} I cannot tell why your minified CSS has these characters. This could be: a … Read more

How to check if a taxonomy not exists in a plugin

You will either need to do two things Check for an empty array AND a WP_Error object Check if the taxonomy exists (which get_categories() and get_terms() already does) before your execute your code and still check for an empty array FEW NOTES TO CONSIDER get_categories() uses get_terms(), you you could use get_terms() You do not … Read more

Does a blank plugin come with any overhead?

No, outside of purely technical aspects of PHP includes (as you correctly pointed out), there is no additional overhead to plugin quantity on general WordPress core load.. The list of active plugins is calculated in advance and stored persistently. The load process just runs over it and performs PHP includes on each. The edge cases … Read more

pagination on data fetched using SQL query

<?php global $wpdb; // QUERY HERE TO COUNT TOTAL RECORDS FOR PAGINATION $total = $wpdb->get_var(“SELECT COUNT(*) FROM (SELECT * FROM muslim LIMIT 0,431) AS a”); $post_per_page = 10; $page = isset( $_GET[‘cpage’] ) ? abs( (int) $_GET[‘cpage’] ) : 1; $offset = ( $page * $post_per_page ) – $post_per_page; // QUERY HERE TO GET OUR … Read more