This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 15 posts - 1,756 through 1,770 (of 18,422 total)
  • Author
    Posts
  • in reply to: Custom fields NOT showing on search (ACF) #51724
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you very much for all the details!

    The issue was, that the operator for the Region selector was incorrect, I fixed it for you: https://i.imgur.com/wJSNXlu.png

    Now the filtering should work as expected.

    in reply to: Search stopped working #51723
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Hiding Search Bar #51709
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Yes, functions.php

    in reply to: Hiding Search Bar #51706
    Ernest MarcinkoErnest Marcinko
    Keymaster

    That is exactly what the code I suggested should do:

    add_filter( 'asp_shortcode_output', function( $output, $id ){
    	if ( $id != 1 ) {
    		return $output;
    	}
    	if ( get_the_ID() == 13702 || get_the_ID() == 2428 ) {
    		return '';
    	}
    
    	return $output;
    }, 10, 2 );

    If it doesn’t work, then there is something wrong I can’t foresee, unfortunately I can’t test this code on my end as it needs the exact same setup as yours.

    If you want, you can add temporary back-end and sFTP access, and I will debug this – it’s probably something very minor. I can’t guarantee anything (as custom code is beyond support), but I can try.

    in reply to: Hiding Search Bar #51703
    Ernest MarcinkoErnest Marcinko
    Keymaster

    With your code variation it happens because the function first checks the page IDs, and when they match, it terminates empty (meaning that the search is not visible).
    The search ID is only checked afterwards and at that point it does nothing whatsoever as on both condition the function terminates with the same output.

    in reply to: Hiding Search Bar #51701
    Ernest MarcinkoErnest Marcinko
    Keymaster

    I don’t know then, the conditions look okay to me. The first condition terminates when the search ID is not 1, aka for all the other search instances in every case.
    Then it goes further down to check the page IDs.

    If you want, I can check directly – but I need temporary back-end and sFTP access to make changes to the code. Can you please add those?

    in reply to: Hiding Search Bar #51699
    Ernest MarcinkoErnest Marcinko
    Keymaster

    That very likely means that the search ID is incorrect in my code. Which search bar is the one in the header? I assumed “HomePage Search” from the screenshot, which had the ID=1.

    in reply to: Hiding Search Bar #51697
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure, we can try that!

    Okay, so with this, the first search (ID=1) on pages 13702 and 2428 should be hidden. Should no affect any other search bars:

    add_filter( 'asp_shortcode_output', function( $output, $id ){
    	if ( $id != 1 ) {
    		return $output;
    	}
    	if ( get_the_ID() == 13702 || get_the_ID() == 2428 ) {
    		return '';
    	}
    
    	return $output;
    }, 10, 2 );
    in reply to: Hiding Search Bar #51695
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Well, this might be better to control via a plugin instead of a custom code.

    Are you using some sort of a block in the header? I’m asking because there is this plugin, which may do exactly what you are looking for. Would that work for you?

    in reply to: Hiding Search Bar #51693
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure!

    I assume you only want to apply this rule to the first search bar (id=1), then this modified version will do the trick:

    add_filter( 'asp_shortcode_output', function( $output, $id ){
    	if ( $id != 1 ) {
    		return $output;
    	}
    	if ( get_the_ID() !== 389 ) {
    		return '';
    	}
    
    	return $output;
    }, 10, 2 );
    in reply to: New featured image not shown in search results #51690
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    The images are not cached, so they are fetched every single time from WordPress core. I logged in and tried a few search phrases, but I’m getting the correct images in the live results list – as far as I could tell.

    Can you link me a post where the image is incorrectly displayed in the search bar? I will check and debug that.

    in reply to: Hiding Search Bar #51689
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Kimberly,

    Surely! I assume you are using a widget/block in the header, but the header is globally displyed everywhere, so you probably can’t adjust that there. However it might still be possible via a custom code.

    I have looked up your home page, it’s ID is 389, so I made a custom code snippet for you, which will check the current page ID, and if it’s not 389, then will intercept the search shortcode and will not print it.

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_filter( 'asp_shortcode_output', function( $output ){
    	if ( get_the_ID() !== 389 ) {
    		return '';
    	}
    
    	return $output;
    } );
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: error message #51687
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 15 posts - 1,756 through 1,770 (of 18,422 total)