Creating MP3 playlist

Yes, this is possible using the correct plugin. Audio Album is just one such plugin. Try searching the plugin repository using a variety of different queries, and you’ll probably find what you are looking for. Here’s a search on “mp3 album“. As for customising the appearance of the player interface, this depends, in part, on … Read more

Send email notification when meet the condition

You can use this code to automatically send an email whenever a post of the type one is published. This goes into your theme’s functions.php : <?php function post_published_notification( $ID, $post ) { $type = get_post_type($ID); if ($type == ‘post-type-one’){ $author = $post->post_author; /* Post author ID. */ $name = get_the_author_meta( ‘display_name’, $author ); $email … Read more

Custom Pin it button is not showing over the image instead it shows as block top_left

I assume you want something like the following: An HTML output could help us to understand the issue more clear. However, you can set the position of the parent to relative, using: p.your-p-class { position:relative} Then, position your button as absolute. .pin-it-button{ position: absolute; top:-50%; left:50%} This will set your pin halfway from top and … Read more

WordPress Plugin default option

$default_data = Array( “plugin551-setting-group” => Array( ‘checkboxoption1’ => ‘true’, ‘checkboxoption2’ => ‘true’ ) ); if ( is_admin() && isset($_GET[‘activate’] ) && $pagenow == ‘plugins.php’ ){ global $default_data; plugin551_save_settings($default_data); } function plugin551_save_settings ( $data ) { if( isset( $data[‘plugin551-setting-group’] )){ array_walk_recursive( $data[‘plugin551-setting-group’] , ‘plugin551_clean_options’); update_option( ‘plugin551-setting-group’ , $data[‘plugin551-setting-group’] ); } } function plugin551_clean_options(&$value) { $value = … Read more

How to display blog posts only authored by the administrator

Four changes to your script. Limit $users to users with ‘administrator’ role. Removed line if($user->caps[‘Administrator’]!=1) continue; as every user is an administrator. Changed ‘post_per_page’ to -1, to process all posts. Added wp_reset_postdata(); after each loop: $users = get_users( array( ‘role’ => ‘administrator’ ) ); foreach ( $users as $user ) { $query = new WP_Query( … Read more

How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?

WordPress uses wp_enqueue_script() to register and enqueue javascript contained in a separate file. The default behavior is for wp_enqueue_script() is to load the script before the </body> tag, and apparently WordPress pages require the script to be loaded in the footer. As pointed out in the comments, the clue to this problem with the loading … Read more

wp doesn’t recognize my plugin if I don’t login as WP user (or as WP Admin)

Although the RFC for cookies implies that dashes are OK in a cookie name, others have experienced issues with using dashes in a cookie name. Try changing the name of the cookie to something without a dash. Only alphanumeric characters are allowed, but underline characters seem to be OK. Reference this question/answer: https://stackoverflow.com/questions/18907771/can-http-cookie-name-contain-dashes/27235182 ; the … Read more