Site logo

Archived topic

Read More Label in Search Result Page

27 replies · Started by Markus on July 18, 2016

Viewing posts 16–28 of 28

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.
:-(

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;
}

That 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';
}

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.

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.

Ah yes, don't trust emails when it comes to code - always come to the forum.

Glad you got it working :)

Still not resolved....

Now the button with the "Masonry Load More Text" is shown on all single posts and pages.

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.
;-)

This code is already working fine for all types of result pages.
Only this button should not be on the single posts and pages.

That 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?

Shame on me.

Instead of
return 'false';

I still had
return $masonry;

Sorry, have a nice weekend!

Done.

You too! :)

This archived topic is closed to new replies.