Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter lmsabino

    (@lmsabino)

    Sorry the post title is “NOT” and not “Now”…

    Plugin Author Nelio Software

    (@nelio)

    Hi! Thanks for using our plugin and for getting in touch with us! I see what you mean.

    Without access to the theme’s source code, it’s hard to offer an exact solution, but my guess is that your theme is not using the (get_)the_post_thumbnail function to print the featured image of a team member (that is, the <img> tag). Probably, this is what it does:

    • It queries if the team member has a featured image (maybe using has_post_thumbnail), which it does because we set an external featured image.
    • It (tries to) recovers its URL assuming it’s in the Media Library (probably using a function called wp_get_attachment_image_src), but no URL image is found/returned, because it’s not in the library.
    • It “manually” prints the <img> tag and inserts the image’s URL (which, as I said, is “empty”) in the src attribute.

    If you’re able to find where the featured image is printed, you may be able to replace the portion of code where the <img> tag is being printed by a call to the_post_thumbnail.

    I hope this sheds some light!

    Thread Starter lmsabino

    (@lmsabino)

    Hi,
    Thank YOU guys for providing this useful Plugin and support!

    I see what you mean – it makes sense, although I cannot write a line of code, in can understand it’s “reasoning”.

    I can search and replace trough the files on the theme and replace the function, but a couple of quiestions come from that:

    1. I know this is probably like looking for a needdle in a haystack, where should I search for this function? Which files would it be more likely to be found? on the “functions.php” file? on CSS? where should I start?

    2. I can just do a simple “search and replace once found and everything should work? Or do I risk destroying other areas of the website?

    Thanks again for your help!

    Plugin Author Nelio Software

    (@nelio)

    Unfortunately, you’re absolutely right: fixing this kind of issue is like looking for a needle in a haystack. Some themes that manually <img> tag have a custom function for doing it (which means you just need to edit one file), others have the printing scattered among multiple files, …

    There’s no general rule for finding quickly what you need, which means you’re alone with your own expertise. You can, of course, contact the theme developer, and ask for his help. If theme developers used the in-my-opinion-better-suited (get_)the_post_thumbnail function, things would be much easier!

    If you want, you can send us a copy of the theme (customers at Nelio Software dot com), and I myself will take a look at the source code. This way, I may be able provide a solution for your issue or, at least, point you in the right direction.

    Thread Starter lmsabino

    (@lmsabino)

    Hi,
    Again, thank you for your answer.

    I have uploaded a copy of the theme I’m using to my dropbox. You can find it here: https://db.tt/Wvp8BxE9

    I’ve contacted support of the theme, but am still waiting for a reply… ??

    If you can take a look and point me in the right direction it would be fantastic!

    Thanks again!

    Plugin Author Nelio Software

    (@nelio)

    Hi! Thanks for sharing the theme, but it would’ve been better if you didn’t share it in public. I’d recommend you remove it from your Dropbox.

    Regarding the issue, it’s been quite easy to fix. Since you’re having trouble with the featured image of your team members, we just need to find which file prints their featured images. The file you need to edit is assets/php/team-members.php. In line 55, you’ll see the following:

    if (has_post_thumbnail()){

    Replace this line with the following code:

    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( get_the_ID() ) ) { ?>
      <span class="img-wrap">
        <a href="<?php echo nelioefi_get_thumbnail_src( get_the_ID() );?>" target="_blank"><?php
          the_post_thumbnail( 'team-thumbnail', array( 'class' => 'rounded' ) );
        ?></a>
      </span>
    <?php
    elseif (has_post_thumbnail()){

    Note that we basically added a new block of code before the already existing block, and that we replaced the original if sentence with a elseif sentence. This new block we added checks if the current post (in this case, a team member) uses an external featured image and, if it does, uses that image.

    Another problem you may encounter is that the featured image is not a perfect circle. If that occurs, just add the following CSS fragment in your theme’s settings:

    .team .nelioefi {
      max-width: 100px;
      max-height: 100px;
    }

    where, of course, you can tune the previous two values as you please.

    I hope this solves your issue!

    Thread Starter lmsabino

    (@lmsabino)

    Thanks again, and WOW for support!

    Good point on the Dropbox file – deleted!

    I had already edited the css as per your comment on the plugin description, to rule out that problem (and hopefully magically make the plugin work…).

    I did the change you suggest and as a result the “Team” section is not loaded annymore, along with all other sections below it.
    So I changed it back… ??

    Plugin Author Nelio Software

    (@nelio)

    Oops! you’re right! I forgot a character…

    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( get_the_ID() ) ) { ?>
      <span class="img-wrap">
        <a href="<?php echo nelioefi_get_thumbnail_src( get_the_ID() );?>" target="_blank"><?php
          the_post_thumbnail( 'team-thumbnail', array( 'class' => 'rounded' ) );
        ?></a>
      </span>
    <?php
    }
    elseif (has_post_thumbnail()){

    Note that I forgot to add a bracket (}) right before the elseif. Sorry for the mistake ;-P

    Thread Starter lmsabino

    (@lmsabino)

    Wow, now it worked!
    THANK YOU!!!!

    I think that only some tweaking on the CSS to get it right as the image is not square…

    Check here to see what I mean: https://dropcanvas.com/bjxy9

    I added the

    .team .nelioefi {
      max-width: 100px;
      max-height: 100px;
    }

    snippet to my style.css file, and it turned to this shape from a big vertical oval.

    Anyway I’ll keep experimenting with the max width and height numbers to try to get it right.

    If you can add to this, it would be just perfect.

    Thread Starter lmsabino

    (@lmsabino)

    Really not getting there with the CSS… ??
    Image keeps showing as an ove instead of a circle.

    Another detail, the image url overrides the “alternative” url that the Theme’s Team page allows to have. So I have the YouTube Channel link on the picture and when I use the remote picture url, I cannot get the Channel link to be the one active. A detail but probably also with an easy fix.

    See here:
    https://thumbmedia.net/#gallery
    The image in the middle (using your plugin) is oval insteado of circle and points to the image url. The other two, using hosted images on the website point to the youtube channel.

    THanks again for all you’ve done so far – you’re the best!

    Plugin Author Nelio Software

    (@nelio)

    Hi! Yes, I know this may occur. In a previous message, I posted the CSS you have to use:

    .team .nelioefi {
      max-width: 100px;
      max-height: 100px;
    }

    I just tested it on Google Chrome, and it’s working.

    Thread Starter lmsabino

    (@lmsabino)

    Ok, the round/oval part is fixed – sorta!

    It’s a bigger circle but it works just the same. I can live with that!

    Here’s the final snippet:

    .team .nelioefi {
      max-width: 100px;
      max-height: 100px;
    }

    Now only the channel link detail is needed…

    Thread Starter lmsabino

    (@lmsabino)

    Sorry, this is the correct one!!

    .team .nelioefi {
      max-width: 200px;
      max-height: 200px;
    }

    Thanks!!

    Plugin Author Nelio Software

    (@nelio)

    Oh, I see the problem. The rule is being overwritten… Try this, instead:

    ul.team li .rounded.nelioefi {
      max-width: 100px;
      max-height: 100px;
    }

    If it doesn’t work, you may also try “forcing” a max-width and max-height using the !important directive.

    Plugin Author Nelio Software

    (@nelio)

    Perfect then! Glad to know you were able to fix the issue.

    Please, don’t forget to rate the plugin and/or comment on it! Other users will appreciate your opinion ??

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Now working on Theme NineZeroSeven’ is closed to new replies.