In past you helped me to shorten the portfolio’s post title and not let it go on two lines. You suggested to me to insert this piece of script in content-portfolio.php
<?php if(etheme_get_option('project_name')): ?>
<?php
$title = get_the_title();
if( strlen( $title ) > 22 ){
$title = substr( $title, 0, 22 ) . '...';
}
?>
Now my question is, is there a way to move this script from content-portfolio.php to style.css? In order to have something like this:
@media only screen and (max-width: 1200px){
/* title is 25 characters */
}
@media only screen and (max-width: 992px){
/* title is 20 characters */
}
@media only screen and (max-width: 768px){
/* title is 15 characters */
}
Thanks