Forum Replies Created

Viewing 15 replies - 16 through 30 (of 57 total)
  • Hi Mike,
    This plugin is designed to not overtake any of the default wordpress areas. This is meant to allow an admin to have authors and editors to have a separate photo that can be use within a theme. You’ll need a firm grasp on WordPress theme development to know how/where to place the example code and use the custom photo.

    The main reason we don’t want to overtake the WordPress defaults for gravatar and avatars is because we want to avoid conflicts. the plugin is designed to specifically to circumvent that and allow an admin to use photos for authors and editors that fit the theme for their site.

    If you’re familiar with theme development, please use the description and readme file to see how to implement this into your theme.

    Regards,
    3five

    Thread Starter 3five

    (@3five)

    Please disregard. I corrected this issue.

    gangov,

    You can start tracing back where to find the author section by looking at the code in single.php. Somewhere in there is a function, hook or code that references post author meta info. If it is using get_template_part() then you’ll have to trace that back to the file being imported there. For example get_template_part('content', 'author') would be found in content-author.php in your theme. From there, you’ll want to find the section that calls the user’s gravatar and replace that with the code above that you added.

    Let me know if this helps.

    Hello Zara!

    The code you need to add, if you are trying to overwrite your comment avatar or gravatar image would reside (most likely, depending on your theme author) in comments.php

    The code you’ll want to add looks something like this:

    <?php
        // Retrieve The Comment Author ID
        $comment_id = get_comment_ID();
        $user_id = get_comment($comment_id)->user_id;
        // Set the image size. Accepts all registered images sizes and array(int, int)
        $size = 'thumbnail';
    
        // Get the image URL using the author ID and image size params
        $imgURL = get_cupp_meta($user_id, $size);
    
        // Print the image on the page
        echo '<img src="'. $imgURL .'" alt="">';
    ?>

    Please note, this will have to be done within the while(have_comments()) loop and it will not work if your theme uses wp_list_comments() unless you create a custom Walker class for your comments.

    Thanks

    Hello gangov,

    Currently that link is producing a 504 error form cloudflare. However I checked into this a day or two ago and it appears that your single.php file is still trying to pull a gravatar image. My best guess (without know your theme or seeing the code) is that you need to trace the code back to where that avatar image is being called. It is most likely using a get_template_part() hook to get the content file.

    For the code that you pasted in the single.php file, is it the same code given as an example snippet in the plugin? Also, can you confirm that the person’s photo you’re trying to get and show is the post author?

    Regards,
    3five

    Hello PaulDoesWP,
    Thank you for taking the time to try our plugin and for leaving a review. Have you read the documentation on the plugin and how to use it? It requires you to have WordPress theme developing knowledge and to also have the ability to add code to your theme.

    We clearly state that this plugin does not automatically take over your user avatars (comments, etc.). The reason for this is it can cause issues within other themes and cause them to break.

    Let us know if we can help you get that working.

    Regards,
    3five

    Hello psicozucca,
    Can you tell me where exactly the image is showing up for you and the other users? Is it on a post? In the WP Admin toolbar (top right of the screen)?

    Also, in your code, how are you retrieving the user id on your site? Dynamically with current_user or something static?

    Regards,
    3five

    Hello deepakyds,

    There is currently no shortcode to allow this to be maintained on the front end. That is not a bad idea though.

    Thanks for the suggestion/comment.

    – 3five

    Hello csleh,
    If you wanted to check for the image with an “if exists” you can do the following:

    Example:

    // Retrieve The Post's Author ID
    $user_id = get_the_author_meta('ID');
    // Set the image size. Accepts all registered images sizes and array(int, int)
    $size = 'thumbnail';
    // Get the image URL using the author ID and image size params
    $imgURL = get_cupp_meta($user_id, $size);
    
    if ( !empty($imageURL) ) {
     // show the custom image
    } else {
    // do something else here
    }

    Hello oshun55,
    Sorry for the delayed response. We be happy to help if we can.

    If you are attempting to use this plugin to replace comment avatars, this can be a bit more complex as you’ll want to loop through the comments and inject your custom photos. This can be done by either creating a new Walker class to add to wp_list_comments() or by using get_comments() and then doing a foreach loop to iterate through them and customize them. Both will require some slightly advanced WordPress and PHP knowledge.

    If you’re simply trying to add this to a single.php page to display the post author’s image, that is much easier. If you do not have a single.php file in your theme directory, it might be in your parent theme directory if you’re using a child theme. Otherwise, you’ll need to backtrack using the WordPress template hierarchy (https://codex.www.ads-software.com/Template_Hierarchy), in which case this is most likely going to be index.php. once you find it, you can use the code snippets provided in the plugin description and modify as needed to get the right user_id,

    Please let us know if this helps and we can try to give you some suggestion to get your images working.

    Cheers,
    3five

    Hello Bryan,
    Currently that is not available but I think it is a good idea now that you bring it up. I’ll see what I can do about adding a “subtitle” description filter to the plugin.

    Cheers!

    Hello Chayre,
    Sorry for the delayed response here.

    Please disregard jdponds responses. We cannot verify nor guarantee the code he is pasting above. This plugin does not need the runkit repo he references.

    The code provided in the examples work perfectly fine and should be used as shown in the example in most cases. The issue you might be having is the user ID. You have to properly fetch the user ID of the person you’re trying to display. The other key is how you’re trying to attach that user to a post or comment, etc.

    Can you provide us with more info on how you intend to use this photo. Is it strictly on posts that you make in your blog or custom post type?

    Regards,
    3five

    Hello Kookidooki,

    Thank you for trying the plugin and responding to the support forum. We are currently testing with 4.2 but have not run into this issue. Can you provide any more info on this in terms of other plugins installed and your current theme.

    Regarding your first 2 questions. We are not currently planning on restricting file types because this plugin uses the WP Media uploader. All files that can be uploaded there are allowed. If we restrict this within our plugin it could cause major conflicts on other themes and plugins.To restrict this yourself, you could write some code in your functions file to restrict this (codex example https://codex.www.ads-software.com/Plugin_API/Filter_Reference/upload_mimes). You could also try a plugin from the repo as well ( i don’t know of one to suggest to you).

    There is no option to add your own additional field nor any plans for this feature in the near future. Could you explain the use case that would benefit from an additional field so we can better understand your idea?

    Thanks

    Hello again,

    Could you please provide some clarification on your multisite environment. By default, If you click network activate as a super admin, the plugin will not show up in their list of plugins because it is controlled by the super admin and not the individual site admin. If you install the plugin and do not use Network Activate, the user will then have the plugin in their list and can freely activate or deactivate the plugin.

    If you installed it as super admin and activated the plugin (not network activated), the plugin should be adding the additional fields to the users profile screen as described.

    Can you confirm you installation process and let me know if you’re seeing those fields on the user profiles?

    Thanks,
    3five

    Great find! Thank you Douglas. I’ll be sure to add this fix to the next release as a bug fix.

    Thanks for trying the plugins and providing feedback.

    Regards,
    3five

Viewing 15 replies - 16 through 30 (of 57 total)