Replace audio links with jplayer using the_content filter

You well need to add a filter to the_content and alter the markup. This should replace the markup for <a> tags having URLs ending in .mp3, which you mentioned specifically in a comment. function replace_audio_link_cb_105555($match) { if (!empty($match[1]) && ‘.mp3’ == substr($match[1],-4)) { $your_long_block_of_markup = ‘<div id=”jquery_jplayer_#uniqueid” class=”jp-jplayer”></div> <div id=”jp_container_#uniqueid” class=”jp-audio”>… and so on …</div>’; … Read more

Add Lightbox To WordPress Native Gallery

By default there is a difference in the HTML output for images inserted alone or via . A direct image link will output an <a href=””> to an actual image mime type, like: <a href=”https://wordpress.stackexchange.com/questions/119659/some-image.jpg”> An attachment <a href=””> outputs an attachment URI like: <a href=”https://wordpress.stackexchange.com/questions/119659/some-link?attachment_id=126″ or ../attachment/2013/ As for a filter I don’t think … Read more

Proper after_setup_theme and wp_head cleanup

What you should do: Read Where to put my code: plugin or functions.php? and apply the lessons to your theme. Themes are for presentation only. Remove everything not related to presentation: do not touch link and meta elements in the header. That’s plugin territory. Remove redundant code. add_theme_support(‘menus’); is not necessary, if you call register_nav_menus(). … Read more

Filtering the post list in the admin area

I would suggest using post_submitbox_misc_actions action as shown in the below example to provide an option for Publish meta-box. <?php add_action( ‘post_submitbox_misc_actions’, ‘my_post_submitbox_misc_actions’ ); function my_post_submitbox_misc_actions(){ ?> <div class=”misc-pub-section my-options”> <label for=”my_custom_post_action”>My Option</label><br /> <select id=”my_custom_post_action” name=”my_custom_post_action”> <option value=”1″>First Option goes here</option> <option value=”2″>Second Option goes here</option> </select> </div> <?php } ?> Once used for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)