WordPress.org

Ready to get started?Download WordPress

Forums

HG Slider
Don't display excerpt on small displays (4 posts)

  1. manukanu
    Member
    Posted 2 months ago #

    How can I disable the excerpt on small devices like smartphones? If I view the slider on my phone, the excerpt is as high as the slider plus the menu above. If I do not display the excerpt but only the title it would be okay. But the excerpt div is the same as the title, so I can't do this by CSS.
    Could you write the excerpt in an own div container?

    Thanks
    Manuel

    https://wordpress.org/plugins/flexslider-hg/

  2. walterrmartin
    Member
    Posted 2 months ago #

    I needed the same thing, so I modified the flexslider-hg.php file to add a selector, until Hal gets time to do it. It is easy to do as long as you have access to your site's plugins directory:

    1. Download the plugin.
    2. Extract flexslider-hg.php from the ZIP file and open it in Notepad or another simple text editor. (Do NOT use Word!)
    3. Add $rtn .= '<' . p . ' class="slide-excerpt flexslider-hg-excerpt">'; on line 250, right above the line that reads $rtn .= get_the_excerpt();
    4. Upload the file to your wp-content/plugins/flexslider-hg folder, overwriting the existing file.

    You can then add .slide-data .flexslider-hg-excerpt { display: none; } after the appropriate media query in your CSS file, and the paragraph tag will help if you just want to style the text.

    Hal, it would be great if you would include this code as-is in your next update, so that nothing will break in my CSS or that of anyone else who uses it. However, I realize you may already have another plan that would require this to be changed.

  3. manukanu
    Member
    Posted 2 months ago #

    Thanks for your help. This would be my solution but there is the problem with a future update. This will overwrite my modifications.
    You can edit a plugin under plugins -> editor also. This is very comfortable.

  4. walterrmartin
    Member
    Posted 2 months ago #

    Do it whichever way you prefer. I never use the file editors within WordPress, especially when editing PHP files, but the result is the same either way. Either method will be overwritten if you upgrade the plugin, which is why I prefer to edit the file on my computer and save a copy. You could also just copy the text from within the plugins editor and save it locally if you are more comfortable doing it that way. I'm more used to using FTP, plus this way I can use the editor of my choice so I get features such as syntax highlighting, error checking, autocomplete, etc. If you make an error in a PHP file, you'll usually be unable to reach the WordPress Admin screen, anyway, so you should be sure you have a direct file upload method available.

Reply

You must log in to post.

About this Plugin

About this Topic