Site logo

Archived topic

image outside of container

13 replies · Started by Alain Aubry on July 3, 2019

Viewing posts 1–14 of 14

Hi

Please give some hint to fix this... see url.
In previous version the image was fitting inside the container.
I haven't done any troubleshooting yet, but something changed since last version.

I have GeneratePress 2.3.2 and GP Premium 1.8.3

Thanks
Alain

Hi there,

This CSS is causing the issue:

.evento .post-image img {
    float: left;
    padding: 2em 2em 0 0;
    margin: 0;
}

If you didn't add it then it would be coming from a plugin.

Let me know if this helps :)

Hi Leo

No, that is not the cause...
there was a change in GeneratePress v2.3.2...
file "content.php" line 59 reads:
<div class="entry-summary" itemprop="text">
it should be:
<div class="entry-content" itemprop="text">

This simple change fixed the issue.
This problem was there for the last month, I did not noticed.

Check out the link.
Thanks
Alain

Hi there,

That element didn't change in GP 2.3.

entry-summary is the class if you're displaying excerpts.

entry-content is the class if you're displaying full content.

It looks like your element has both of those classes. Are you using a custom page template for this archive in your child theme?

Hi Tom

Your explanation about the classes makes total sense.
When troubleshooting I just added the second class and this fixed the issue.
I don't have a custom template for "evento", I do have some filters, like:

add_filter( 'generate_blog_get_column_count', 'indigo_cpt_featured_column' );
function indigo_cpt_featured_column( $featured_column ) {
		if ( is_post_type_archive( 'evento' ) ) {
        return true;
    }
    return $featured_column;
}

and

add_filter( 'generate_blog_columns', 'indigo_cpt_columns' );
function indigo_cpt_columns( $columns ) {
		if ( is_post_type_archive( array( 'actividade', 'colaborador', 'course', 'curso' ) ) || is_tax( array( 'grupo', 'tipo', 'course_cat', 'course_tag' ) ) ) {
        return true;
    }
		if ( is_post_type_archive( 'evento' ) ) {
				return false; // no columns, full width
		}
		return $colmns;
}

and

add_filter( 'generate_category_post_navigation', 'indigo_category_post_navigation' );
function indigo_category_post_navigation() {
		$post_types = array( 'colaborador', 'actividade', 'evento' );
		if ( in_array( get_post_type(), $post_types ) ) :
			return false;
		else :
			return true;
		endif;
}

Also this one:

add_filter( 'wp_trim_excerpt', 'indigo_excerpt_metabox_more' );
function indigo_excerpt_metabox_more( $excerpt ) {
		$output = $excerpt;
		$settings = wp_parse_args(
				get_option( 'generate_blog_settings', array() ),
				generate_blog_get_defaults()
		);
		if ( has_excerpt() ) {
				$output = sprintf(
						'%1$s <p class="read-more-container"><a class="button" href="%2$s">%3$s</a></p>',
						$excerpt,
						get_permalink(),
						wp_kses_post( $settings['read_more'] )
				);
		}
		return $output;
}

All of these snippets were taken from different topics from the documentation and this forum.
All of them are included in child theme 'functions.php'.
I am no expert, but I am good at troubleshooting things.

Thank you
Alain

Hi

I have another copy at https://dev.casa-indigo.com/eventos/

This installation has not been modified, I just changed the event date in order to display several of them.
Note that the middle one has "entry-summary" and was created yesterday, while testing.
The other two were created last May 2, today I changed the event date, they have "entry-content".

Also note that both classes have only have this rule:

.page-content, .entry-content, .entry-summary {
    margin: 2em 0 0;
}

Ah, so you added the entry-summary class yourself?

There are a few reasons why entry-content would display over entry-summary:

1. Your blog content is set to show the full content in Customize > Layout > Blog.
2. You're using the more tag: https://docs.generatepress.com/article/using-the-more-tag/
3. You're using a post format other than "standard".

Are any of those true in your case?

Ah, so you added the entry-summary class yourself?
File “content.php” line 59 reads:
<div class="entry-summary" itemprop="text">
I changed to:
<div class="entry-summary entry-content" itemprop="text">

Questions:
1. No, see here https://snag.gy/L7rjN0.jpg
2. Yes, classic editor
3. No, it is CPT "evento" with quite basic features, no post format

  register_post_type( 'evento', array(
    'rewrite' => array(
			'slug' => 'eventos',
			'with_front' => false
		),
    'supports' => array( 'title', 'editor', 'excerpt', 'author', 'page-attributes', 'thumbnail', 'custom-fields' ),
    'has_archive' => true,
    'public' => true,
		'hierarchical' => false,
		'show_ui' => true,
		'show_in_menu' => true,
		'show_in_nav_menus' => true,
		'show_in_admin_bar' => true,
		'menu_position' => 5,
		'can_export' => true,
		'has_archive' => true,
		'exclude_from_search' => false,
		'publicly_queryable' => true,
		'capability_type' => 'post',
    'labels' => $evento_post_label,
    'menu_icon' => 'dashicons-calendar'
	));

TOTALLY MY FAULT!

Thank you so much for your guidance!...
I have been using the "more tag" in every other event, but this last one.
I entered a more tag and restored the file "contents.php" to original.

THANK YOU AGAIN

No problem :)

Hi

I am still curious on why the "evento" cpt requires to use "more tag" in every post, otherwise breaks the display. Normal posts can use or not the "more tag" as an option. Normally I always have a manual excerpt. The "evento" cpt includes the excerpt field and in this case it was filled.

Thanks again

How does it require the more tag? The more tag will always result in the entry-content class being used. We can use a filter to turn that off if you'd like so the excerpt is always used?

No, never mind...
I will just remember to use a more tag every time I create an event.
After this experience I am sure I will not forget of doing it.
Thanks
Alain

No problem :)

This archived topic is closed to new replies.