[Resolved] Search bar customization

Home Forums Support [Resolved] Search bar customization

Home Forums Support Search bar customization

Viewing 15 posts - 16 through 30 (of 41 total)
  • Author
    Posts
  • #2287715
    Sabbir

    no

    #2287719
    David
    Staff
    Customer Support

    How did you add the Shortcode to that page ?

    #2288013
    Sabbir

    in child Theme Functions
    (functions.php)

    #2288124
    Fernando
    Customer Support

    I tested the code from my end, and it’s not adding a <code> tag like yours does.

    Most likely, as mentioned by Ying, it may be from a plugin or a custom code.

    Can you try disabling all non-GP plugins again, and we’ll check from our end how it goes? If you have a staging site, you can do it there instead.

    Hope to hear from you soon.

    #2288141
    Sabbir

    Hi,

    I did it, please check it fast for me.

    #2288158
    Fernando
    Customer Support

    Thank you for testing. I can confirm that it’s still there.

    Since your functions.php only includes the code provided by David, by any chance, do you have any custom code added through a Hook Element?

    Kindly let us know.

    #2288161
    Sabbir

    here are my 3 active element: https://prnt.sc/IwQr0VqcoG30

    #2288170
    Fernando
    Customer Support

    I see. There’s nothing there that should cause the issue as well.

    Can you try this code instead?:

    add_shortcode('cat_listing', function($html){
        $categories = get_categories();
        $cat_html = '<div class="my-category-term-list">';
        foreach( $categories as $category ) {
            $cat_html .= sprintf( 
                '<h3 class="term-title entry-title"><a class="term-links" href="%1$s" alt="%2$s">%3$s</a></h3>',
                esc_url( get_category_link( $category->term_id ) ),
                esc_attr( $category->name ),
                esc_html( $category->name )
            );
            
        }
        $cat_html .= '</div>';
        return $cat_html;
    
    });

    Kindly let us know how it goes.

    #2288172
    Sabbir
    #2288186
    Fernando
    Customer Support

    Thank you for testing that, can you test this instead?:

    add_shortcode('cat_listing', function($html){
        $categories = get_categories();
        $cat_html = '<div class="category-term-list">';
        foreach( $categories as $category ) {
            $cat_html .= sprintf( 
                '<h3 class="my-term-title my-entry-title"><a class="my-term-links" href="%1$s" alt="%2$s">%3$s</a></h3>',
                esc_url( get_category_link( $category->term_id ) ),
                esc_attr( $category->name ),
                esc_html( $category->name )
            );
            
        }
        $cat_html .= '</div>';
        return $cat_html;
    
    });

    I’m replacing the class name one by one to see if that may resolve the issue. Sorry for the back-and-forth.

    #2288189
    Sabbir
    #2288257
    David
    Staff
    Customer Support

    In the editor – how was the shortcode added to the page ? Is it in a Shortcode Block ?

    #2288266
    Sabbir

    Sorry, David, I paste the shortcode normally, as I did, I hoped it will automatically get a shortcode block but it was not, I didn’t notice that.

    now I delete this block added a shortcode block and past the code. now, this is the result. now I just need an arrow with link.

    here is the current result: https://www.disabilityresources.org/cat.html

    #2288302
    David
    Staff
    Customer Support

    Thats ok – its working now 🙂
    You can use this CSS:

    
    .category-term-list .term-title {
        position: relative;
    }
    .category-term-list .term-title::after {
        color: #777;
        content: "\2192";
        font-weight: 300;
        font-size: 20px;
        position: absolute;
        top: 0;
        right: 0;
    }
    #2288304
    Sabbir

    It looks good

Viewing 15 posts - 16 through 30 (of 41 total)
  • You must be logged in to reply to this topic.