Forum Replies Created

Viewing 15 replies - 1 through 15 (of 65 total)
  • Thread Starter Nic727

    (@nic727)

    Thank you. It works!

    Thread Starter Nic727

    (@nic727)

    By digging a bit, I found it may be a problem with TranslatePress. Have to press space – How-to and Troubleshooting – wpDiscuz Support Forum

    However, by disabling/enabling rich editor, it now works.

    Edit: Nope, it’s gone again.

    Edit 2: The second solution here works: Translatepress causes problem with comments | WordPress.org

    • This reply was modified 1 year, 1 month ago by Nic727.
    • This reply was modified 1 year, 1 month ago by Nic727.
    Thread Starter Nic727

    (@nic727)

    ok, I’ve found that the other plugin to translate theme is working for most of the static text.

    However, I’m unable to understand how to be able to translate the dynamic text entered via the customization panel.

    My functions.php

    $wp_customize->add_setting( 'main_title', array(
            'type' => 'theme_mod',
            'default' => '',
            'sanitize_callback' => $pgwp_sanitize
        ));
    
        $wp_customize->add_control( 'main_title', array(
            'label' => __( 'Titre principal', 'aurora' ),
            'type' => 'text',
            'section' => 'aurora_default_cs'
        ));
    
        $wp_customize->add_setting( 'sub_title', array(
            'type' => 'theme_mod',
            'default' => '',
            'sanitize_callback' => $pgwp_sanitize
        ));
    
        $wp_customize->add_control( 'sub_title', array(
            'label' => __( 'Sous-titre', 'aurora' ),
            'type' => 'text',
            'section' => 'aurora_default_cs'
        ));
        // Register strings for translation
        function register_theme_strings() {
            pll_register_string('aurora', get_theme_mod('main_title'), 'aurora', true);
            pll_register_string('aurora', get_theme_mod('sub_title'), 'aurora', true);
        }
        add_action('init', 'register_theme_strings');

    And in my front-page.php

    <div class="home-title"> 
                <h1><?php echo pll__(get_theme_mod( 'main_title' )); ?></h1> 
                <h2><?php echo pll__(get_theme_mod( 'sub_title' )); ?></h2> 
            </div>  

    I don’t see anything in the main translation interface to translate the string appearing there.

    What did I do wrong?

    Thank you!

    Thread Starter Nic727

    (@nic727)

    ok I fixed my problem with ChatGPT help lol.

    Into functions.php

    $wp_customize->add_setting( 'home_vid', array(
            'type' => 'theme_mod',
            'sanitize_callback' => $pgwp_sanitize
        ));
        $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'home_vid', array(
            'label' => __( 'Home video', 'aurora' ),
            'type' => 'media',
            'mime_type' => 'video',
            'section' => 'aurora_default_cs'
        ) ) );
        function allow_video_upload( $existing_mimes ) {
            $existing_mimes['mp4'] = 'video/mp4';
            $existing_mimes['mov'] = 'video/quicktime';
            // Ajoutez d'autres extensions de fichiers vidéo si nécessaire
            return $existing_mimes;
         }
         add_filter( 'mime_types', 'allow_video_upload' );

    Now just call the video on your page with

    $video = wp_get_attachment_url( get_theme_mod( 'home_vid' ));
    
     echo '<video id="home-video" class="featured-video" width="320" height="240" autoplay loop muted>
                    <source src="' . esc_url($video) . '" type="video/mp4" />
                    Your browser does not support the video tag.
                </video>';

    You can add some more elements like if to see if the video exist before calling it.

    However, it now works and just need to fix a small looping issue, but overall it’s working great!

    Thread Starter Nic727

    (@nic727)

    Half working. The font style is removed, but I have a problem with the padding.

    https://i.postimg.cc/xdNVtJKs/image.png

    EDIT: Fixed by adding some size to layout options.

    {
        "version": 2,
        "settings": {
            "appearanceTools": true,
            "layout": {
    			"contentSize": "800px", <---- HERE
    			"wideSize": "80%" <---- HERE
    		},
            "spacing": {
                "blockGap": true,
    			"units": [
    				"%",
    				"px",
    				"em",
    				"rem",
    				"vh",
    				"vw"
    			]
    		}
        }
    }
    • This reply was modified 2 years, 5 months ago by Nic727. Reason: Fixed
    • This reply was modified 2 years, 5 months ago by Nic727.
    Thread Starter Nic727

    (@nic727)

    Currently, my form only show error message after you click the submit button. I would like to change it show error when the input lose focus.

    Thread Starter Nic727

    (@nic727)

    I saw some YouTube video showing you can create subscription form with Contact Form 7, but I don’t think it works, because in the video they are not showing how it’s linked to the newsletter provider.

    But I guess I could use the Integration add on for CF7 for Mailchimp or Mailerlite, but there is no tutorial on how to use that with a checkbox saying « check to subscribe ». If you can find any tutorial, I would be happy to read or watch it.

    But I think CF7 need to evolve because it’s missing some key features like drag and drop and validate when out of focus like Everest Form.

    Thread Starter Nic727

    (@nic727)

    I think you misunderstood my suggestion. I know with theme you can create custom breakpoints and all. That’s what I’m doing for my site.

    What I mean, is that WordPress Gutenberg items already have breakpoints.

    Ex.:

    @media (max-width: 600px)
    .wp-block-media-text.is-stacked-on-mobile {
        -ms-grid-columns: 100%!important;
        grid-template-columns: 100%!important;
    }

    Sometime you would like to use something higher than 600px. My idea was that instead of changing all blocks manually inside your own CSS stylesheets, you would just need to enter new numbers in the admin panel (a bit like what you can do with media size).

    Not sure how it would works since it’s not really possible to change CSS dynamically… Maybe having different stylesheet like normal.css, tablet.css and mobile.css and call them when it reach a breakpoint.

    But I would understand if this idea wouldn’t work or is not very important.

    Thread Starter Nic727

    (@nic727)

    Thanks!

    Thread Starter Nic727

    (@nic727)

    Have this issue too.

    1. I created a reusable block.
    2. I went to reusable block editor/manager
    3. I created a new block from there
    4. The new block is not showing.
    5. I deleted all reusable block and I still have one unnamed reusable block in the list of block I can choose, but it’s not in the list in the block manager…

    What’s going on?

    Thread Starter Nic727

    (@nic727)

    So easy. I don’t know how I missed that lol.

    Thread Starter Nic727

    (@nic727)

    Thank you very much. I kinda fixed everything. I will keep my display:hidden stuffs, just because I don’t want to break anything, but I edited some of the comment form via the custom array ‘author’ => ”, etc.

    Kinda work now.

    Thank you for your answer 😉

    Thread Starter Nic727

    (@nic727)

    Hi again, I found this https://core.trac.wordpress.org/browser/tags/5.7.2/src/wp-includes/comment-template.php

    However, I only found the code for the list in version 4.0.1. I don’t understand why it doesn’t show up in 5.7.2?

    Whatever, I copied the code I found in my functions.php under a new function name and I will remove and modify what need to be done.

    But for the form, the code is way too long, so I was thinking about using the field array and just add another div in “author” and the closing div in “url”, so I can wrap them all inside something else and modify how it looks from there. Is that what I should do?

    For AJAX, I guess it can work the same way by adding code into the fields area and show the error code there.

    Thank you in advance

    • This reply was modified 3 years, 1 month ago by Nic727.
    • This reply was modified 3 years, 1 month ago by Nic727.
    Thread Starter Nic727

    (@nic727)

    @bcworkz Thank you. I think it would be easier for me to work live with someone else to show me what to do… However, I’m trying my best to understand all this complexity and I’m kind of stuck.

    I would like to take all the comment list and comment form code and modify it for my need, but I’m not sure to understand all the source code here https://developer.wordpress.org/reference/functions/comment_form/ and https://developer.wordpress.org/reference/functions/wp_list_comments/

    My problems :

    1. wp_comment_list()
    I just wanted to remove the “says” span which I found is useless. I now use a display:none, but I feel like it’s just loading useless thing on the page. Same for the href for the timestamp of the comment which I removed by adding a pointer-event:none, but the link is still loading…

    2. wp_comment_form()
    The whole form is weirdly made. I would like the inputs (name, email, website), to be inside a div. I saw a site who did it, but I can’t find anything on the developer website that can add a container around the input. Also, is it possible to remove the labels and put placeholder?

    3. Errors
    I saw that if you enter wrong email, it goes to a different WP error page. Is it possible to just style the area or add some AJAX instead?

    Where can I find the the default callback for the form and list, so I can just edit or remove the part I don’t want?

    • This reply was modified 3 years, 1 month ago by Nic727.
    • This reply was modified 3 years, 1 month ago by Nic727.
Viewing 15 replies - 1 through 15 (of 65 total)