Site logo

Archived topic

Add read more link to custom excerpts on Custom Post Type

13 replies · Started by Alfonso on June 10, 2021

Viewing posts 1–14 of 14

Hi there, i need to add Read More link to custom Excerpts on Custom Post Type,

im tried wit this code:

add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;

if ( has_excerpt() ) {
$output = sprintf( '%1$s %3$s',
$excerpt,
get_permalink(),
__( 'Read more', 'generatepress' )
);
}

return $output;
}

But is not working

Hi Elvin,

I've been solved.

So i have a new question, how i can change breakpoints?

I need tablet mode change from 768px to 1200px, is not possible?

Hi Elvin,

I've tried Tom's filter and is not working :(

You can check at:

https://aelmhu2.111pixels.com/

From 1025px to 1280px i have problems with header, font size etc...

As mentioned previously, it won't be fully effective because some CSS are hardcoded to the following breakpoints:

@media(min-width:1025px) - bigger desktops
@media(min-width:769px) and (max-width: 1024px) - tablet and smaller desktop
@media(max-width:768px) - mobile viewport

You can find these @media rules through all the .css files of the theme.

To change these, I'm afraid you'll have to manually override them w/ custom CSS.

But is not possible to make mobile header until to 1200px for example?

Hi there,

if its just the Mobile Header you want to change the breakpoint - go to Customizer > Layout > Primary Navigation and increase the Mobile Menu Breakpoint to 1200

Thank you David.

The other contents do you recommend that i must apply new custom css styles to font size etc...?

I have another question, im trying to make a full with image on my archive pages but the image having only the container with.

However, on a normal page, if I get the image to be full witdh.

Single page:

https://aelmhu2.111pixels.com/articulos-de-revision/

Archive page (generate_inside_site_container):

https://aelmhu2.111pixels.com/noticias/

I've added this content on "Before main content" Hook and i have also tried "inside_site_container" Hook but both with the same result.

https://aelmhu2.111pixels.com/entrevistas/ (before_main_content)

Hi Alfonso,

If you want the image to be full width, try after_header hook instead.

The other contents do you recommend that I must apply new custom css styles to font size etc…?

I'm afraid so.

Thank you very much Elvin!

No problem. Glad to be of any help. :D

This archived topic is closed to new replies.