Support » Plugin: Front-end Editor » [Plugin: Front-end Editor] Can't Manually Position the Edit Button for Theme Images

  • This plugin is awesome for almost everything. So first, thank you for making it.

    When I add a theme image and click the edit button it works fine. But when I manually position the edit button it doesn’t trigger the popup. I have the manually positioned edit buttons working on a few other fields so I know it’s not that. It’s something wrong with the positioning for Theme Images specifically. Could have something to do with calling the popup.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author scribu


    Please post the code you’re using, which is not working.

    Here’s the code:

    <aside id="background">
    	<?php if(current_user_can('manage_options')) : ?><div class="fee-group">
    		<div class="fee-buttons"></div><?php endif; ?>
    				// Check to see if the header image has been removed
    				$header_image = get_header_image();
    				if ( $header_image ) :
    					// Compatibility with versions of WordPress prior to 3.4.
    					if ( function_exists( 'get_custom_header' ) ) {
    						// We need to figure out what the minimum width should be for our featured image.
    						// This result would be the suggested width if the theme were to implement flexible widths.
    						$header_image_width = get_theme_support( 'custom-header', 'width' );
    					} else {
    						$header_image_width = HEADER_IMAGE_WIDTH;
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    					// The header image
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    					else :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    					<?php editable_image(
    	'headshot', get_header_image(), array(
    		'width' => $header_image_width,
    		'height' => $header_image_height,
    		'alt' => 'My Headshot'
    	)); ?>
    				<?php endif; // end check for featured image or standard header ?>
    			<?php endif; // end check for removed header image ?>
    		<div id="background-top"></div>
    		<div id="background-right"></div>
    		<div id="background-bottom"></div>
    		<div id="background-left"></div>
    		<?php if(current_user_can('manage_options')) : ?></div><!-- .fee-group #background --><?php endif; ?>
    	</aside><!-- #background -->

    The image is the default header image for the theme, but it allows you to switch it to a new one. It works great with the non-manually positioned button, but the problem is that those <div>’s at the bottom are gradients that fade out the outside of the image to black. So when I move my mouse to the edge it rolls over those gradient divs and then it’s not hovering the main image so the default edit button disappears.

    Plugin Author scribu


    This seems like a problem with your theme’s CSS then.

    Also, it seems you already opened a topic about this issue:

    Either way, I will not be looking into this until after WP 3.5 ships (with a completely revamped image management interface).

    That’s possible. Does the manually placed edit button do anything different than the default one? I just removed the stuff that was blocking the default one from working to test it and the default one works fine, but the manual button still doesn’t work.

    Does the manual button use a different javascript function to call the thickbox?

    Alright. I did some more research. This is what I get in the console when I click the manually placed edit button:

    TypeError: editor.create_form is not a function
    [Break On This Error]

    …;for(value in _ref){if(!,value))continue;…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Front-end Editor] Can't Manually Position the Edit Button for Theme Images’ is closed to new replies.