WordPress.org

Ready to get started?Download WordPress

Forums

Simple Staff List
[resolved] Staff Photo / Featured Image Not Working (18 posts)

  1. polybearsfootball
    Member
    Posted 1 year ago #

    Hi,

    I have found a plugin conflict that is causing the custom Staff Photo / Featured Image to not stick.

    I am using your Simple Staff List, and the Team Rosters plugin. Results of combinations are as follows:

    Team Rosters always works as intended, which is why I am writing here.

    If only Team Rosters is ACTIVE it works as intended.

    If only Simple Staff List is ACTIVE it works as intended.

    If both are ACTIVATED the Team Rosters works as intended, but the Staff List Image does not.

    So, activating Team Rosters breaks your image feature. Since yours customizes the Featured Image I am writing here to find a fix, but will post there too. Thanks for any help you may have.

    Razz

    http://wordpress.org/extend/plugins/simple-staff-list/

  2. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm...I just did a quick test on my test install of my plugin and I was able to have both plugins activated and still add a new staff member with image. I tried using an image already in my media library as well as uploading a new image and both worked.

    Which version of WordPress are you running?
    Which version of Simple Staff List are you running?
    Which version of Team Rosters are you running?

    Thanks!

  3. polybearsfootball
    Member
    Posted 1 year ago #

    Thanks for the response Brett, and for testing this. First the answers to your questions, and then an observation...

    WordPress: 3.5.1
    Simple Staff List: 1.14
    Team Rosters: 2.0.1

    Originally I thought this was a theme issue, and I reached out to the developer. (Info Below), But then we saw that Featured Image was working with all the plugin's but Simple Staff List and the Dev suggested a plugin conflict. De-activating ALL plugins, except these 2, results in the issues described. After further testing on my end I see a few interesting things:

    When Team Rosters is active, Simple Staff List in the case has a phantom image in the Set Featured Image browse dialog.

    For example: In this case with both active, the Set Feature Dialog in Team Roster looks normal. In SSL, there is an unknown (?) thumbnail. Selecting it shows no info. If I deactivate Team Rosters that goes away.

    If I switch to the Twenty Tweleve theme everything works - that would normally lead me back to the theme, BUT the theme's Featured Image does work or the Team rosters plugin would fail too. I am not sure where to look in this odd case. The theme technically works - at least with TR, but it is a combo of TR and the theme causing issues, but the only issue is SSL.

    Any ideas? I will reach back to theme devs too.

    Themefuse Versions:

    Framework 2.4.6
    ThemeMods 2.0.6
    Templates 2.0.5

    Thanks,

    Razz

  4. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Man, that is really strange. Are you seeing any javascript errors? I can't, for the life of me, figure out why that particular plugin/theme combo of Rosters, SSL, and Themefuse would be causing a problem like that.

    Since Themefuse is a premium template service, I won't be able to test this on my own. But could you try something for me? In simple-staff-list.php comment out line 231. This is the line that calls the function to rename the "Featured Image" metabox. I'm curious to know if this is the culprit.

    Thanks!

  5. polybearsfootball
    Member
    Posted 1 year ago #

    Thanks Brett for the reply. As I recall, I tried that already. I even swapped the code around a bit playing to see if I could trigger anything obvious, but no errors at all. Weird, and with 3 products interacting, it is a tough troubleshoot/debug. I can write code fine but without knowing all the products it's a fun one.. I have the TR plugin author involved too, and he was going to have me test some changes. Themefuse has FTP access now too, and they are going to see if it's them. I will be sure to try that again to be safe and let you know the result.

    Thanks again man, I will get back to you on the result,

    Razz

  6. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, thanks. I'm interested to see hat the theme dev comes back with.

  7. polybearsfootball
    Member
    Posted 1 year ago #

    I commented out the line 231:

    //add_action('do_meta_boxes', 'sslp_staff_member_featured_image_text');

    The result is no featured image box at all. Normally Themefuse does not use FI, but it has been enabled in the child theme functions.php with:

    add_theme_support('post-thumbnails');

    And the TR plugin has one that works. I know he specified the custom post typr in his code of 'player', but the line I put in functions.php should do anything.

    Weird.

  8. polybearsfootball
    Member
    Posted 1 year ago #

    Oh yeah, one more thing along with the info above... I find the phantom ? image only showing up in SSL interesting. Just thinking out loud because the puzzle is now becoming fun.

    Razz

  9. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    That's really weird. I've asked around at work and the consensus is that it's either theme related (since I'm able to use both plugins without error on another site) OR something to do with the server environment. I just can't figure out why featured images would work on everything except my plugin since I'm just using the default WP featured image picker.

    Keep me updated. :)

  10. polybearsfootball
    Member
    Posted 1 year ago #

    Hey Brett,

    Just an FYI, I found the issue to be caused by the Team Rosters plugin use of the following code from in the plugin:

    'add_action( 'after_setup_theme', 'mstw_tr_add_feat_img' );
    function mstw_tr_add_feat_img( ) {
    if ( function_exists( 'add_theme_support' ) )
    add_theme_support( 'post-thumbnails', array( 'player' ) );
    }'

    It actually looks correct to me, so I have no idea why it is causing this weird phantom image in the FI dialog, or blocking any other plugin from saving a Featured Image.

    Either way, I just wanted to let you know the result.

    Razz

  11. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    That is very strange. Check out this thread...seems to be a similar issue. add_theme_support Post Thumbnails Multiple Times?

    I'm curious as to why the plugin is using add_theme_support. I would think that's something that should be left to the theme to determine and not the plugin.

    Thanks for the update!

  12. polybearsfootball
    Member
    Posted 1 year ago #

    Well, in this post:

    He mentions he added it "because some themes deactivate the Featured Image meta box", and Themefuse themes do not natively support Featured Images by the way. I added it back in my child theme's functions.php. Plus, adding it in a plugin guarantees the feature will be there if the theme is changed, plus he is using custom post types, so adding the custom post type of "Player" to the array helps if them was overly specific on "Posts" or "Pages".

    I will also, that like you, he is amazingly responsive. That link seems to maybe be the issue, that his use of add_theme_support() is overwriting the theme setting. I will pass this onto him, and THANKS. Seriously, the two of you are very helpful, and that is VERY appreciated.

    razz

  13. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah, I guess he and I have differing opinions on whether the plugin or theme should control whether or not featured images are 'supported' by the theme. In my opinion, every modern theme should be have featured images enabled, whether or not they actually use them. Why turn off a feature of core? Haha.

    Oh well. I'm glad I was able to help you get it sorted out! And thanks for using Simple Staff List! :)

  14. polybearsfootball
    Member
    Posted 1 year ago #

    I tend you agree with you, although I do see the point made in the link you mentioned:

    " if you look at it from an MVC approach, a custom post type is a model and the theme is the view. They should be separate, and the WordPress way to do that is a plug-in."

    Razz

  15. polybearsfootball
    Member
    Posted 1 year ago #

    Brett, I did review the plugin, and it is 5 stars. Thanks.

  16. Brett Shumaker
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the review!! I really appreciate it!

  17. invot
    Member
    Posted 11 months ago #

    So here's my DON'T DO THIS THOUGH IT WORKS answer:

    I decided to use Advanced Custom Fields to solve this problem. I created a custom field for the featured image. Linked it to post type "staff-member", made the return value the Image URL, and then went into the plugin files for Simple Staff...
    Editing simple-staff-list/_inc/user-view-show-staff-list.php, replace this code on line 88...

    if(has_post_thumbnail()){
    
    			$photo_url = wp_get_attachment_url( get_post_thumbnail_id() );
    			$photo = '<img class="staff-member-photo" src="'.$photo_url.'" alt = "'.$title.'">';
    		}else{
    			$photo_url = '';
    			$photo = '';
    		}

    ...with this code...

    if(get_field('profile_image')) {
    			$photo_url = get_field('profile_image');
    			$photo = '<img class="staff-member-photo" src="'.$photo_url.'" alt = "'.$title.'">';
    	  } else {
    			$photo_url = '#';
    		$photo = '<img class="staff-member-photo" src="'.$photo_url.'" alt = "'.$title.'">';
    	  }

    This is a bad fix (though it works) because (1) you're using another plugin to fix this plugin and (2) updating this plugin is now going to null the work you did.

  18. Sebin Simon
    Member
    Posted 8 months ago #

    hi
    i can not upload feature images in my custom template.
    when trying to upload there's no response and no messages.
    plugin works in default template

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic