- This topic has 27 replies, 2 voices, and was last updated 9 years, 8 months ago by
Tom.
-
AuthorPosts
-
July 23, 2016 at 9:04 am #212252
Markus
Hi Tom,
thank you very much. Without your help I’stuck.
๐And yes, it helps on the Tag pages, very nice.
But: the Search Result Pages and the Blog Page lost masonry.
๐July 23, 2016 at 9:24 am #212253Markus
This way it works!!!
//Masonary style on Tag Pages// add_filter( 'generate_blog_masonry','generate_custom_masonry' ); function generate_custom_masonry() { return 'true'; return $masonry; }July 23, 2016 at 9:29 am #212254Tom
Lead DeveloperLead DeveloperThat will enable masonry everywhere on the site as you’re just returning true no matter what.
You could try something like:
add_filter( 'generate_blog_masonry','generate_custom_masonry' ); function generate_custom_masonry() { if ( is_tag() || is_search() || is_home() || is_archive() ) return 'true'; return 'false'; }July 23, 2016 at 9:59 am #212270Markus
You’re right.
I found out already and tried to figure out how to tweak it.
You were faster.That’s it.
Thank you again.July 23, 2016 at 10:03 am #212273Markus
FYI: in the first time I just copied your solution from my mail client.
Because the Apostroph were encoded to & # 039 ; it crashes the system.
I guess the mail function of your forum replaces the ‘ with an entity.July 23, 2016 at 11:10 am #212286Tom
Lead DeveloperLead DeveloperAh yes, don’t trust emails when it comes to code – always come to the forum.
Glad you got it working ๐
July 23, 2016 at 1:18 pm #212328Markus
Still not resolved….
Now the button with the “Masonry Load More Text” is shown on all single posts and pages.
July 23, 2016 at 1:21 pm #212332Markus
I guess I have to buy you another coffee when this is resolved.
But, Jesus, 10$ for a coffee in Vancouver Island?
Wonder how you make ends meet.
๐July 23, 2016 at 1:22 pm #212334Tom
Lead DeveloperLead DeveloperCan you try the adjusted code above?: https://generatepress.com/forums/topic/read-more-label-in-search-result-page/page/2/#post-212254
Ha! You can adjust that $10 to whatever you like ๐
It’s expensive here, but luckily not that expensive, yet!
July 23, 2016 at 1:27 pm #212337Markus
This code is already working fine for all types of result pages.
Only this button should not be on the single posts and pages.July 23, 2016 at 1:28 pm #212338Tom
Lead DeveloperLead DeveloperThat button should only appear if masonry is set to true.
The code above should only apply masonry those conditionals, which don’t include is_single() or is_page().
Are you sure the function you added where it just said return ‘true’; isn’t still in there?
July 23, 2016 at 1:52 pm #212344Markus
Shame on me.
Instead of
return ‘false’;I still had
return $masonry;Sorry, have a nice weekend!
Done.
July 23, 2016 at 1:53 pm #212345Tom
Lead DeveloperLead DeveloperYou too! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.