Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter doowayne

    (@doowayne)

    Thank you for your response.

    Deactivating WPML doesn’t help because the problem only impacts the translated versions of the website. I can’t reproduce it in any other case, and the translation is a critical feature of the website.

    I did more investigation on what I could, and observed something interesting : I tried replacing Relevanssi Live Ajax Search with SearchWP Live Ajax Search, and it appears that the bug also occurs with that plugin. This means that the problem might not be caused by Relevanssi Live Ajax Search specifically, but a wordpress feature used by both plugins.

    I also found what seems to cause the bug on custom post-types : the problem only occurs when the post type’s slug is rewritten (in my case, ‘tutorials’ is rewritten as ‘knowledge-base’ for the urls). If the slug isn’t rewritten, everything works properly.

    With all those elements, I will contact WPML support and try asking on the main worpdress forum, as it definitely doesn’t seem specific to Relevanssi Live Ajax Search plugin, but common to several plugins doing the same thing.

    Thank you again for your help.

    • This reply was modified 1 year, 4 months ago by doowayne.
    Thread Starter doowayne

    (@doowayne)

    I used the filter like this :

    add_filter( 'relevanssi_live_search_results_template', function(){ return dirname( __file__) . "/relevanssi-live-ajax-search/search-results.php";} );

    But the following error occurs when using the search bar :

    Warning: include(C:\wamp64\www\doc_center\wp-content\themes\knowledgebase\relevanssi-live-ajax-search\search-results.php): Failed to open stream: No such file or directory in C:\wamp64\www\doc_center\wp-content\plugins\relevanssi-live-ajax-search\includes\class-relevanssi-live-search-client.php on line 76

    It also doesn’t work on the online version.

    Am I not using the correct path ?

    Thread Starter doowayne

    (@doowayne)

    This is what I get when using this filter hook :

    [01-Jan-2025 19:18:13 UTC] C:\wamp64\www\doc_center\wp-content\plugins\relevanssi-live-ajax-search/templates/search-results-query.php
    Thread Starter doowayne

    (@doowayne)

    Thank you for your response.

    I double-checked and the repertory is correctly named, and the website is not using any other Ajax search.

    I tried modifying the templates directly from the extension repertory on a local environment, and it appears that the on that is used to display the results is search-results-query.php. But it also doesn’t work when I put search-results-query.php in my theme’s repertory.

    Thread Starter doowayne

    (@doowayne)

    It works ! Thank you for your help !

    Thread Starter doowayne

    (@doowayne)

    Thank you for your response !

    If I put top: 86px it does display correctly on my desktop, but it’s not responsive. I was hoping there was a way to fix it without having to define a specific value manually for every display (and without having to change it if I modify anything in this section of the website).

    • This reply was modified 1 year, 6 months ago by doowayne.
    Thread Starter doowayne

    (@doowayne)

    My code now looks like this :

    if ( ! function_exists( 'theme_setup' ) ) :
    function theme_setup() {
    wp_enqueue_style(
    'custom-style',
    get_template_directory_uri() . '/assets/css/search-bar.css' );
    }
    endif;

    add_action( 'wp_enqueue_scripts', 'theme_setup' );

    And it works ! Thank you so much for your help !

    Thread Starter doowayne

    (@doowayne)

    Thank you for your response !

    I am working with a child theme of Twenty Twenty-Four for this project, I made sure to use the function.php file of my child theme.

    For the theme_setup function I actually forgot the last line when quoting my code :

    add_action( 'init', 'theme_setup' );

    I actually tried to replicate the way it is done in the parent theme, to customize the CSS for the button block.

    if ( ! function_exists( 'twentytwentyfour_block_stylesheets' ) ) :
    /**
    * Enqueue custom block stylesheets
    *
    * @since Twenty Twenty-Four 1.0
    * @return void
    */
    function twentytwentyfour_block_stylesheets() {
    /**
    * The wp_enqueue_block_style() function allows us to enqueue a stylesheet
    * for a specific block. These will only get loaded when the block is rendered
    * (both in the editor and on the front end), improving performance
    * and reducing the amount of data requested by visitors.
    *
    * See https://make.ww.wp.xz.cn/core/2021/12/15/using-multiple-stylesheets-per-block/ for more info.
    */
    wp_enqueue_block_style(
    'core/button',
    array(
    'handle' => 'twentytwentyfour-button-style-outline',
    'src' => get_parent_theme_file_uri( 'assets/css/button-outline.css' ),
    'ver' => wp_get_theme( get_template() )->get( 'Version' ),
    'path' => get_parent_theme_file_path( 'assets/css/button-outline.css' ),
    )
    );
    }
    endif;

    add_action( 'init', 'twentytwentyfour_block_stylesheets' );

    I replaced the code with your suggestion, but the result remains the same : the CSS is applied in the editor, but not on the front-end.

    Thread Starter doowayne

    (@doowayne)

    I am not sure what fixed this issue but it is now solved, my custom blocks now appear in the editor.

    Thread Starter doowayne

    (@doowayne)

    Thank you for your response (and sorry for the lateness of mine).

    Reading the article you linked I think I understand fairly well what I can do to customize the query loop block, but I am not sure if that would work for my case.

    The way I did it with a classic theme is by running a wp_query loop within a get_terms loop that fetches and display all the subcategories available. From what I understand I can customize the query and its parameters, and I could include the subcategory notion and use it as a parameter for my query, but that wouldn’t allow me to group posts by subcategory and display the subcategory name the same way as in my example.

    Or I am misunderstanding and it is possible to customize the query loop block by including the post query in another loop ?

    Thread Starter doowayne

    (@doowayne)

    You were right, this behavior was caused by the plugin WP JV Post Reading Groups, which doesn’t seem to be maintained so I guess it’s a good opportunity to change it.

    Thank you so much for your help !

Viewing 11 replies - 1 through 11 (of 11 total)