[Theme: P2] media button – frontend
-
Hello all.
I’m curious if someone can shed some light. I’m trying to add the same media upload button similar to the p2theme but in my theme. I’ve added,
function p2_media_buttons() { // If we're using http and the admin is forced to https, bail. if ( ! is_ssl() && ( force_ssl_admin() || get_user_option( 'use_ssl' ) ) ) { return; } include_once( ABSPATH . '/wp-admin/includes/media.php' ); ob_start(); do_action( 'media_buttons' ); // Replace any relative paths to media-upload.php echo preg_replace( '/([\'"])media-upload.php/', '${1}' . admin_url( 'media-upload.php' ), ob_get_clean() ); }
to my functions.php. I also added this,
<div id="media-buttons" class="hide-if-no-js"> <?php p2_media_buttons(); ?> </div>
to where I have my post form in the front end. I’m not getting errors, but the media window isn’t popping up.
Your help is very much appreciated!
Thanks,
-John
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Theme: P2] media button – frontend’ is closed to new replies.