WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
Can't Manually Position the Edit Button for Theme Images (8 posts)

  1. marcmus
    Member
    Posted 1 year ago #

    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.

    http://wordpress.org/extend/plugins/front-end-editor/

  2. scribu
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. marcmus
    Member
    Posted 1 year ago #

    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; ?>
    		<?php
    				// 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( '/' ) ); ?>">
    				<?php
    					// 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 ?>
    			</a>
    			<?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 -->
  4. marcmus
    Member
    Posted 1 year ago #

    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.

  5. scribu
    Member
    Plugin Author

    Posted 1 year ago #

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

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

    http://wordpress.org/support/topic/plugin-front-end-editor-manually-placed-edit-button-bug-with-theme-image-editor

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

  6. marcmus
    Member
    Posted 1 year ago #

    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.

  7. marcmus
    Member
    Posted 1 year ago #

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

  8. marcmus
    Member
    Posted 1 year ago #

    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]

    ...ref=this.data.values;for(value in _ref){if(!__hasProp.call(_ref,value))continue;...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.