Support System page display issue

Hi

We are developing a multi language site using WPML and recently installed Support System. Have configured it, modified css etc and just noticed that despite being duplicates, the Contact page where Support is loaded, does not display in the same way on the translated pages? 2 screenshots are attached – English GBP page which is the correct one and a translation – English USD where the issue can be seen.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bize

    Hope you are doing good today :slight_smile:

    Its because the CSS file of support system is loading on the page you selected in settings to avoid loading un-necessary files loading on all pages.

    You can override this behaviour and load it with your theme on entire site by following simple steps.

    1. Disable loading of default style from Support > Settings > Front End > Use Support System styles to avoid duplication.

    2. Now go plugins/incsub-support/assets/css, copy incsub-support.css file and move it to your active theme or child theme css folder via FTP or FileManager.

    3. Now add following code in functions.php file of your theme or child theme.

    /**
    * Proper way to enqueue scripts and styles
    */
    function wpmu_load_css_scripts() {
    wp_enqueue_style( 'incsub-support-custom-css', get_stylesheet_directory_uri().'/css/incsub-support.css' );
    }

    add_action( 'wp_enqueue_scripts', 'wpmu_load_css_scripts' );

    Now you can customise the style, layout according to your requirement without fear of being overridden while updating the plugin.

    Note: We strongly recommend using child themes for editing files to stay safe when you update the plugin/theme. Here is a nice writeup on how to create your own child theme.

    https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    Hope that helps :slight_smile:

    Cheers, Sajid

  • BizE
    • Site Builder, Child of Zeus

    Hi Sajid

    Thanks and have implemented what you suggest, with mixed results. The general layout, colors and fonts are now displaying correctly on the translated pages, but the div – “support-system-attachments” containing the “Add files” button and “Allowed file types etc” is still not displayed . . . hmmm?

    Thanks,

    Paul

  • Sajid
    • DEV MAN’s Sidekick

    Hi @paul

    Hope you are doing good today :slight_smile:

    Yup, its still not loading the js files for attachments. I have updated the code, provided in my last reply. Replace this one with existing code (posted in last reply) in functions.php and let me know how it goes.

    /**
    * Proper way to enqueue scripts and styles
    */
    function wpmu_load_css_scripts() {
    wp_enqueue_style( 'incsub-support-custom-css', get_stylesheet_directory_uri().'/css/incsub-support.css' );

    $allowed_mimes = incsub_support_get_allowed_mime_types();
    $allowed_mimes = array_keys( $allowed_mimes );

    $allowed_mimes = array_map( function( $element ) {
    return str_replace( '|', ', *.', $element );
    }, $allowed_mimes );

    $allowed_mimes = '*.' . implode( ', *.', $allowed_mimes );

    $l10n = array(
    'button_text' => __( 'Add files...', INCSUB_SUPPORT_LANG_DOMAIN ),
    'remove_file_title' => __( 'Remove file', INCSUB_SUPPORT_LANG_DOMAIN ),
    'remove_link_text' => __( 'Remove file', INCSUB_SUPPORT_LANG_DOMAIN ),
    'desc' => '<p>(' . sprintf( __( 'Allowed file types: %s', INCSUB_SUPPORT_LANG_DOMAIN ), $allowed_mimes ) . ')</p>'
    );

    wp_localize_script( 'support-system-init', 'support_system_i18n', $l10n );
    wp_enqueue_script( 'support-system-init' );
    wp_enqueue_style( 'support-system' );
    wp_enqueue_style( 'support-system-adminbar' );
    }

    add_action( 'wp_enqueue_scripts', 'wpmu_load_css_scripts' );

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bize

    Hope you are doing good today :slight_smile:

    I am sorry to hear that it still did not work for you. If its okay for you, then please send FTP and WordPress admin details via our secure contact form in following format. I will try to figure it out and fix it on your site.

    Subject: “Attn: Sajid Javed

    -WordPress admin username

    -WordPress admin password

    -login url

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant urls

    Select “I have a different question” for your topic – this and the subject line ensure that it gets assigned to me :slight_smile:

    https://premium.wpmudev.org/contact/

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bize

    Hope you are doing good today :slight_smile:

    I am sorry for the delay on this ticket and thanks for sending through FTP details.

    I have fixed this issue on your site and now attachments are working fine there. For any one else having similar issue I have made following changed to make this button appear.

    Go to wp-content/plugins/incsub-support/inc/classes/ open up class-shortcodes.php file with your editor.

    Find following code in this file:

    public function enqueue_scripts() {
    if ( is_support_system() ) {
    wp_enqueue_script( 'support-system-init' );
    wp_enqueue_style( 'support-system' );
    wp_enqueue_style( 'support-system-adminbar' );
    }
    }

    …replace it with this code.

    public function enqueue_scripts() {
    wp_enqueue_script( 'support-system-init' );
    wp_enqueue_style( 'support-system' );
    wp_enqueue_style( 'support-system-adminbar' );
    }

    Save changes and upload this file back to server.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • BizE
    • Site Builder, Child of Zeus

    Hi Sajid

    Sorry for the delay in getting back, thank you for this and I confirm that it is working ok now.

    Is this a custom edit for us though, that we need to save or can you confirm if the edits you have made will now be included in any future plugin upgrades, so that we do not lose this functionality?

    Regards,

    Paul

  • Sajid
    • DEV MAN’s Sidekick

    Hi @paul

    Hope you are doing good today and you are welcome :slight_smile:

    I am flagging developer to have support for WPML included in future versions of this plugin. But meanwhile take a backup of the changes we have done, in case you need that again.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • BizE
    • Site Builder, Child of Zeus

    Hi Sajid

    Looking at old tasks and realise that I had not got back to ask about the mod we made on 29th Sept – see above where you provided some code to add to our functions.php file.

    After your later edit to the plugin itself, please can you let me know if we should still have the older edit in the functions.php file?

    Thanks & regards,

    Paul

  • Sajid
    • DEV MAN’s Sidekick

    Hi @bize

    Hope you are doing good today and welcome back :slight_smile:

    The code provide in this reply should be in functions.php file. https://premium.wpmudev.org/forums/topic/support-system-page-display-issue#post-959975

    However you can delete this code from functions.php file if exists.

    https://premium.wpmudev.org/forums/topic/support-system-page-display-issue#post-960745

    Also make sure you keep backup of these changes in case you update your theme of plugin.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.