#136377 Custom translate for SEARCH PAGE

Landing Forums JupiterX WordPress Theme Custom translate for SEARCH PAGE

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • daniolodaq-f06002bd

    Hello,
    Using this tutorial:

    I was able to translate the new search title and subtitle, however, I am having trouble translating the following secondary title and subtitle because they repeat, as you can see in screenshot #1

    Please show me how I can translate “SEARCH FOR:” and the lower secondary subtitle.

    I am attaching the screenshots,

    daniolodaq-f06002bd

    Additionally, how do I change the typography of the H3 secondary title to H2 and the bottom caption in the “NEXT” navigation?

    Nodari Support Team

    Hey there

    Ok, let me check it, please provide access details to your website in a private reply and we will investigate your problem

    Regards

    Private
    daniolodaq-f06002bd
    This reply has been marked as private.
    Mohsin Al-Rabieai Support Team

    Hi Danial,

    In order to translate any art of the theme, it is recommended to use the LocoTranslate plugin. After activating this plugin, you can find any text related to the theme through LocoTranslate -> Themes -> Jupiter X or LocoTranslate -> Plugins -> Jupiter X Core.

    Please note that some of the texts might be coming from WordPress itself so you may also take a look at the WordPress texts if you couldn’t find them.

    In order to change the secondary title tag to h2, please use this PHP snippet on jupiter x child functions.php file:

    jupiterx_remove_action( 'jupiterx_search_page_secondary_title' );
    
    jupiterx_add_smart_action( 'jupiterx_content_before_markup', 'jupiterx_search_page_secondary_title_custom' );
    /**
     * Echo search page secondary title section.
     *
     * @since 1.0.0
     *
     * @return void
     */
    function jupiterx_search_page_secondary_title_custom() {
    	if ( ! jupiterx_search_has_result() ) {
    		return;
    	}
    
    	jupiterx_open_markup_e( 'jupiterx_search_secondary_title', 'h2', [ 'class' => 'jupiterx-search-secondary-title' ] );
    
    		printf( '%1$s%2$s', jupiterx_output( 'jupiterx_search_secondary_title_text', esc_html__( 'Search results for: ', 'jupiterx' ) ), get_search_query() ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Pending security audit.
    
    	jupiterx_close_markup_e( 'jupiterx_search_secondary_title', 'h2' );
    
    	jupiterx_open_markup_e( 'jupiterx_search_secondary_subtitle', 'p', [ 'class' => 'jupiterx-search-secondary-subtitle' ] );
    
    		// translators: Number of found search posts.
    		printf( jupiterx_output( 'jupiterx_search_secondary_title_text', __( 'We have found some results with the word you searched.', 'jupiterx' ) ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Pending security audit.
    
    	jupiterx_close_markup_e( 'jupiterx_search_secondary_subtitle', 'p' );
    }

    It removes the current h3 tag and will create a new one with h2.

    Hope it helps šŸ™‚

    daniolodaq-f06002bd

    Hello Mohsin,

    Your advice was helpful, thank you.
    I would also like to have the ability to upgrade the appearance of the search results page.

    I am attaching screenshots of what I care about. I am trying to figure out on my own how to change the css look on this results page, however, I need help.

    What is the easiest way I can affect the appearance of each div/container/section/widget on the search results page?

    daniolodaq-f06002bd

    Hello again,

    In addition, after adding the above code to the jupiterx-child theme in functions.php, when creating new section templates, it displays a caption from the code, in each newly created template

     

    Mohsin Al-Rabieai Support Team

    Hi there,

    Regarding the issue with the section template, I changed the code to this:

    jupiterx_remove_action( 'jupiterx_search_page_secondary_title' );
    
    jupiterx_add_smart_action( 'jupiterx_content_before_markup', 'jupiterx_search_page_secondary_title_custom' );
    /**
     * Echo search page secondary title section.
     *
     * @since 1.0.0
     *
     * @return void
     */
    function jupiterx_search_page_secondary_title_custom() {
    	if ( ! is_search() ) 
    	{
    		return;
    	}
    	if ( ! jupiterx_search_has_result() ) {
    		return;
    	}
    
    	jupiterx_open_markup_e( 'jupiterx_search_secondary_title', 'h2', [ 'class' => 'jupiterx-search-secondary-title' ] );
    
    		printf( '%1$s%2$s', jupiterx_output( 'jupiterx_search_secondary_title_text', esc_html__( 'Search results for: ', 'jupiterx' ) ), get_search_query() ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Pending security audit.
    
    	jupiterx_close_markup_e( 'jupiterx_search_secondary_title', 'h2' );
    
    	jupiterx_open_markup_e( 'jupiterx_search_secondary_subtitle', 'p', [ 'class' => 'jupiterx-search-secondary-subtitle' ] );
    
    		// translators: Number of found search posts.
    		printf( jupiterx_output( 'jupiterx_search_secondary_title_text', __( 'We have found some results with the word you searched.', 'jupiterx' ) ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Pending security audit.
    
    	jupiterx_close_markup_e( 'jupiterx_search_secondary_subtitle', 'p' );
    }

    It appears to be resolving the issue.

    In order to change the image height and add a border to the search results, please add the following to Customizer -> Additional CSS:

    body.search-results .jupiterx-post-image img {
        height: auto;
        max-width: 100px;
    }
    
    body.search-results .jupiterx-post-image.col-md-4 {
        flex: 0 0 10%;
    }
    
    body.search-results .jupiterx-post {
        border: 1px solid #e9e9e9;
        padding: 15px
    }

    It should give you a look like this: https://ibb.co/X7fZHsV

    ——

    To change the product description on the search page, you need to add the support of Excerpts for your custom post type first via Jet Engine like this:

    Screen-Shot-2021-12-05-at-13-50-49

    Then you will be able to add an excerpt to each post:

    Screen-Shot-2021-12-05-at-13-50-26


    Whatever you put on this box, will be shown as your product description.

    Hope it helps šŸ™‚

    Bests

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.
Login