Responsive excerpts

Is there any way of responsively deciding to use an excerpt? So if the screen size is a certain size, the text will become an excerpt?

There is no way PHP can determine the screen size, because it’s a server side language. You could use Javascript to get the screen size on the client side and post that to a script on the server

Other than that, if you want to display the excerpt on mobile only, you may want to have a look at mobile detect: http://mobiledetect.net

1 Like