Site logo

Archived topic

Configuring the read more class

6 replies · Started by Milo Lam on June 16, 2021

Viewing posts 1–7 of 7

Hi,
I currently have a <p class="read-more-container"></p> before <span class="comments-link"></span> in my blog category archive. I'm most certain that with the way I'm positioning it (in a DIY kind of way) using margins right now, it's not in correct position in responsive mode.

Is there a way to move <p class="read-more-container"></p> after <span class="comments-link"></span> (picture)?

Thank you!

Hi Milo,

There's no hook for this within the theme's codes unfortunately.

You may have to edit the theme files if you have to do this.

But if I may suggest, consider taking advantage of GP Premium 2.0's Block Element - Content Template. You can create your own layout using this feature. With this you can align or put the entry metas and the read more button on the same container element.

I see. Do you mind elaborating on how to approach it using Block Element?
Thank you!

I see. Do you mind elaborating on how to approach it using Block Element?
Thank you!

I believe it's best to see for yourself. I highly suggest watching Leo's demo on how to work with it. It's a great tool to have. :)
https://www.youtube.com/watch?v=8byA37OTBRg

I appreciate it. Trying it out so far and it's getting very close. Never knew GP had this. So cool!
Thanks

Hey again, sorry to bother but the Element I had layout-wise looks good. However, a function snippet I had previously that added a date tag like this now looks like this.

The function snippet is:

add_filter( 'generate_post_date_output', function($post_date){
	if( is_archive() ){
		$post_date = sprintf(
			'<time class="entry-date published" datetime="%1$s"><span class="entry-date">%2$s</span><span class="entry-month">%3$s</span></time>',
			esc_attr( get_the_date( 'c', $id ) ),
			esc_html( get_the_date( 'd', $id ) ),
			esc_html( get_the_date( 'M', $id ) )
		);

		return $post_date;
	}
	return $post_date;
},15,2);

Any idea how I would be able to put it back? Thanks

Try this out.

add_filter( 'generate_dynamic_element_text', function( $post_date, $block ){
    if ( 'post-date' === $block['attrs']['gpDynamicTextType'] ) {
		$post_date = sprintf(
			'<time class="entry-date published hahaha" datetime="%1$s"><span class="entry-date">%2$s</span><span class="entry-month">%3$s</span></time>',
			esc_attr( get_the_date( 'c', $id ) ),
			esc_html( get_the_date( 'd', $id ) ),
			esc_html( get_the_date( 'M', $id ) )
		);	
	}
	return $post_date;
},15,2);
This archived topic is closed to new replies.