Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to add ellipsis?

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #240802
    Doom_87
    Participant

    Hello everyone.
    I hope I’m putting this in the correct section!

    I’m trying to build a site with wordpress and I’m a newbie.
    I’m using a plugin for excerpts on my posts, it’s called “Easy Custom Auto Excerpt”. However, the plugin does not offer the option to have ellipsis attached in the last word of the excerpt and it seems a bit weird to cut of a sentence like that.

    I wanted to ask if I could somehow edit the plugin’s php to add ellipsis attached to the last word of the excerpt.

    I pasted it’s code below:
    http://pastebin.com/SBQqb1i6

    I think it’s the correct php because it had many in it.

    I tried contacting the plugin’s authors but they only made things worse since I gave them my login details and kinda messed up some things.

    Anyway, I hope you can help me out and sorry if it’s a silly question :)

    #240805
    Paulie_D
    Member

    I gave them my login details and kinda messed up some things.

    Seriously!? Never, EVER, do this….

    Multiline ellipsis is quite hard to achieve in CSS.

    Whether it’s something PHP can do is beyond me.

    #240808
    Senff
    Participant

    I always use my own function to show an excerpt of something, based on the number of words.

    The function (put this in your function.php or custom plugin file):

    function custom_excerpt($limit,$moreText = '') {
      $excerpt = explode(' ', get_the_excerpt(), $limit);
      if (count($excerpt)>=$limit) {
        array_pop($excerpt);
        if ($moreText) {
          $excerpt = implode(" ",$excerpt).'... <a href="'.get_the_permalink().'" class="read-more">'.$moreText.'</a>';
        } else {
          $excerpt = implode(" ",$excerpt).'...';
        }
      } else {
        $excerpt = implode(" ",$excerpt);
      }
      $excerpt = preg_replace('`[[^]]*]`','',$excerpt);
      return $excerpt;
    }
    

    Within the loop, call it using:

    echo custom_excerpt(40);
    

    Or something like:

    echo custom_excerpt(35,'Read full article');
    
    #241048
    pkinchla
    Participant

    what about

    .excerpt:after {
       content:'...';
    }
    
    
    #241095
    nkrisc
    Participant

    I tried contacting the plugin’s authors but they only made things worse since I gave them my login details and kinda messed up some things.

    Off topic but, “wow.” That’s insane, you should never give a random person admin access to your site. For all you know, they’ve installed malware or other malicious code on your site.

    #241097
    Senff
    Participant

    I’m a plugin developer and sometimes, when a user needs help, they offer to give me login info to check out their site. Most of the time I make clear that I can’t/won’t do that, to avoid any possibility of “hey something broke on my site now, what did you do??

    #241107
    Doom_87
    Participant

    Is there a way to see if they have put any malicious code?

    #241113
    Senff
    Participant

    Only if you know what you’re looking for. To go scour all the code and hope you stumble upon something malicious, might take a long while.

    Then again, “malicious” is a broad term. Maybe they did something that messed it up, but that doesn’t necessarily mean it’s malicious (with bad intent).

    But you could ask them what they did exactly, and then try to undo it all.

    #241114
    Doom_87
    Participant

    I asked them and they just said that it’s their plugin’s issue and will be fixed in the next update, nothing else.

    I don’t know if I’m sure what they mean.
    Apparently communication is not their strong point, it makes me skeptical… :/

    #241122
    Senff
    Participant

    When you say “they messed things up”, does that mean things are still messed up when you deactivate their plugin?

    It’s not really clear to me what you mean by it, so it’s hard to tell if they busted your site code, or some settings, or just did something to their own plugin, or…..

    Either way, if you can clear up what it is they did, then it should be easier to undo it.

    #241124
    Doom_87
    Participant

    I don’t know what they messed up but I’ve seen speed drops that’s since they logged in that’s why I assume they changed something.

    Another things that worries me is my Google Analytics Summary pages that shows:

    Top Searches

    www.share-button.xyz - 29 Visits
    (not provided) - 12 Visits
    http://website-stealer-warning-alert.hdmoviecamera.net - 2 Visits
    http://website-stealer-warning-alert.hdmoviecams.com - 2 Visits
    

    Maybe it has nothing to do with the plugin but I’d like to know what you think.

    Note that my site is closed to public by an Under Construction plugin since it’s not ready yet but I disable it from time to time to test things in a new private window.

    #241149
    I.m.learning
    Participant

    My host’s server allows me to check my own analytics. I also keep lots and lots of backups for all my files. If I ever mess up bad enough, I just delete my server files and upload the latest backup files. That way, there is no doubt my code is free of errors.

    I actually thought I was hacked because I saw a ‘pear’ error with my PHP; but then saw they had PHP Pear on one of my Cpanel options. Additionally, I do not have access to my htaccess file, this was when I tried to use their IPblocker.

    I don’t use plug-ins. I do, however, link to other people’s site for Bootstrap. I do believe maxcdn is reputable and that is where I link, and many others too, for certain compatibility issues.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Back End’ is closed to new topics and replies.