Forum Replies Created

Viewing 15 replies - 1 through 15 (of 33 total)
  • Thread Starter Amilus

    (@amilusc)

    Thank you Stefano,

    I just checked the Newsletter documentation and created a newsletter page.
    Here I put:

    [newsletter_form button_label="Subscribe" target="_tab"]
    [newsletter_field name="email" label="E-mail"]
    [/newsletter_form]

    However the button opens on the same window other than a new tab.
    I also tried target=”blank” and target=”_blank”, but with no luck.

    Am I mistaking my shortcode here?

    Best,

    Amilus

    Thread Starter Amilus

    (@amilusc)

    Hi not a problem at all!
    I actually reached WPML’s support and everything’s working wonderfully perfectly now!

    Thanks a lot for all your help!
    You really are the most helpful and best plug-in author I’ve met.

    Amilus

    Thread Starter Amilus

    (@amilusc)

    Hi thanks a lot!
    I will have a try with WP touch’s support team to see if it could be fixed.

    Thank you so much for your great help!

    Thread Starter Amilus

    (@amilusc)

    Hi it does re-size the height but now the problem is that,
    not all the slideshow on my blog has the same height.

    Now my old post which uses sildeshow gallery does not display correctly:
    http://a-unefille.com/2015/01/16/summer-in-budapest/

    The height of the slideshow is too big that it overlays the text below!

    Is there a way to make the height and the width 100% which could work well on different size of window?
    Same with the tiled gallery, could I make the width by percentage proportion, too?

    My other concern is,
    the slideshow css style sheet does not seem to effect on my mobile site.
    The black border exists and the height is too much on my mobile site.

    I’m using WP touch plug-in for my mobile site, should I ask the support from WP touch or could this be fixed by editing my css stylesheet?

    Many thanks!

    Thread Starter Amilus

    (@amilusc)

    Hi wooassist,

    Thanks it works out perfectly!

    Thread Starter Amilus

    (@amilusc)

    Long time Hector!
    And Happy New Year!

    Well here’s what HostGator told me regarding the gif issue after a long LiveChat with the technical supporter:

    When the plugin uses the wordpress image editor with imagemagick, it uses too much memory which corrupts the gif more than likely due to animation.

    And after switching off the Imagemagick the gif issue was solved.
    Although this issue does not bother me anymore after using the customised code, but just to keep you posted as you might be interested to know.

    As for the WPML WPPP problem, the widget now works great in different languages.
    The only small problem now is the WPPP on the front page – it does link to the correct language posts but the title is not translated.

    Best

    Thread Starter Amilus

    (@amilusc)

    Dear Petra,

    Thank you for the reply!

    Here’s the gif image that failed the thumbnail generation:
    http://a-unefille.com/wp-content/uploads/2014/04/pb0110.gif

    In fact I’ve reached my server company and turned off the imageKick thing then the thumbnail showed up as a still image without problem.

    I had imageKick on back again, so I’m not sure if the same problem will happen again when next time using a gif image as featured image.

    Best and Happy New Year!

    Amilus

    Thread Starter Amilus

    (@amilusc)

    Dear Hector,

    Saying thank you to you just isn’t enough to all the time and effort you spent on this issue.
    I feel bad not paying you tuition fee and coding fee as your support for this free plug-in is so much greater than those paid plug-in…

    I really wish that I could tell you finally this time everything is right now (in fact, almost true! The home page popular posts is really perfect now!).

    However, it seems that the custom_popular function just doesn’t effect the wppp sidebar widget anymore.

    And the WPPP widget in the sidebar does not function with WPML now, even if I take out the entire costume_popular function code, WPPP in the sidebar still doesn’t function with WPML.

    The WPPP on the home page works totally fine with WPML though.

    Here’s my final code:

    <?php
    function get_excerpt_by_id( $post_id ){
    
        $the_post = get_post( $post_id ); //Gets post ID
        $the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
        $the_excerpt = strip_tags( strip_shortcodes($the_excerpt) ); //Strips tags and images
    
        if ( defined('ICL_LANGUAGE_CODE') && (ICL_LANGUAGE_CODE == 'ja' || ICL_LANGUAGE_CODE == 'zh-hant') ) {
    
            $excerpt_length = 180; //Sets excerpt length by letter count
    
            if ( strlen($the_excerpt) > $excerpt_length ) {
                $the_excerpt = mb_substr( $the_excerpt, 0, $excerpt_length ) . "...";
            }
    
        } else {
    
            $excerpt_length = 35; //Sets excerpt length by word count
            $words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
    
            if ( count($words) > $excerpt_length ) :
                array_pop($words);
                array_push($words, '...');
                $the_excerpt = implode(' ', $words);
            endif;
    
        }
    
        $the_excerpt = '<p>' . $the_excerpt . '</p>';
    
        return $the_excerpt;
    
    }
    function custom_popular( $mostpopular, $instance ){
    
        $output = '<ul class="wpp-list">';  
    
        // Code for home page
        if ( is_front_page() ) {
    
            foreach( $mostpopular as $popular ) {
    
                // WPML support
                if ( defined('ICL_LANGUAGE_CODE') && function_exists('icl_object_id') ) {
    
                    $current_id = icl_object_id( $popular->id, get_post_type( $popular->id ), true, ICL_LANGUAGE_CODE );    
    
                    $title = get_the_title( $current_id );
                    $permalink = get_permalink( $current_id );
                    $thumbnail = get_the_post_thumbnail( $current_id, 'popular', array('alt' => esc_attr($title), 'title' => esc_attr($title), 'class' => 'wpp-thumbnail') );
                    $excerpt = "<span class=\"wpp-excerpt\">" . get_excerpt_by_id( $current_id ) . "</span>";
    
                }
                else {
    
                    $title = $popular->title;
                    $permalink = get_permalink( $popular->id );
                    $thumbnail = get_the_post_thumbnail( $popular->id, 'popular', array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') );
                    $excerpt = "<span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>";
    
                }
    
                /*
                 * Build popular post HTML
                 */
    
                // Show bigger thumbnail for the first image
                if ( 0 == $counter ) {
                    $thumbnail = get_the_post_thumbnail( $popular->id, 'popular', array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') );
                    $output .= "<div id=\"most-liked-left\"><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$thumbnail}</a></li><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li><li>{$excerpt}</li></div>";
    
                }
                else { // Regular output
                $thumbnail = get_the_post_thumbnail( $popular->id, 'square', array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') );
                $output .= "<div id=\"most-liked-side\"><ul><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$thumbnail}</a></li><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li><ul></div>";
    
                }
    
                // Increase counter
                $counter++;
            }
    
        } // HTML code for the rest of the site
        else  {
    
            foreach( $mostpopular as $popular){
                //WPML support
                if ( defined('ICL_LANGUAGE_CODE') && function_exists('icl_object_id') ) {
                    $current_id = icl_object_id( $popular->id, get_post_type( $popular->id ), true, ICL_LANGUAGE_CODE );
                    $title = get_the_title( $current_id );
                    $permalink = get_permalink( $current_id );
                }
                else {
                    $title = $popular->title;
                    $permalink = get_permalink( $popular->id );
                }
    
                $output .="<li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li>";
            }
    
        }
    
        $output .= '</ul>';
    
        return $output;
    }
    add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );
    ?>

    P.S. No longer related to this plug-in but just to keep you posted for the earlier gif thumbnail issue: the same problem happens again with another plug-in(WordPress Related Posts). I am still seeking support from HostGator to solve it. It seems that there is an error in the gif generated and resized by plug-ins.

    P.P.S. I’ve never learned coding systematically, I am a self-learner copy/paste codes from internet. This is my first time building a wp website. And I really don’t know how I could express my appreciation to all the help and things I learned from you…

    Thread Starter Amilus

    (@amilusc)

    Thank you so much!

    Here’s the code in function.php

    function get_excerpt_by_id( $post_id ){
        $the_post = get_post( $post_id ); //Gets post ID
        $the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
        $the_excerpt = strip_tags( strip_shortcodes($the_excerpt) ); //Strips tags and images
    
        if ( defined('ICL_LANGUAGE_CODE') && (ICL_LANGUAGE_CODE == 'jp' || ICL_LANGUAGE_CODE == 'cn') ) {
    
            $excerpt_length = 180; //Sets excerpt length by letter count
    
            if ( strlen($the_excerpt) > $excerpt_length ) {
                $the_excerpt = mb_substr( $the_excerpt, 0, $excerpt_length ) . "...";
            }
    
        } else {
    
            $excerpt_length = 35; //Sets excerpt length by word count
            $words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
    
            if ( count($words) > $excerpt_length ) :
                array_pop($words);
                array_push($words, '...');
                $the_excerpt = implode(' ', $words);
            endif;
    
        }
    
        $the_excerpt = '<p>' . $the_excerpt . '</p>';
    
        return $the_excerpt;
    }
    
    function custom_popular( $mostpopular, $instance ){
         if ( is_front_page() ) {
        $counter = 0;
    
        $output = '<ul class="wpp-list">';  
    
        foreach( $mostpopular as $popular ) {
    
            $permalink = get_permalink($popular->id);
            $excerpt = "";
    
            // Different output for the first post: show different thumbnail and post excerpt (summary)
    
            if ( 0 == $counter ) {
    
                $thumbnail = get_the_post_thumbnail( $popular->id, 'popular', array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') );
                $excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>";
                $output .= "<div id=\"most-liked-left\"><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$thumbnail}</a></li><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li><li>{$excerpt}</li></div>";
    
            }
             else { // Regular output
                $thumbnail = get_the_post_thumbnail( $popular->id, 'square', array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') );
                $output .= "<div id=\"most-liked-side\"><ul><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$thumbnail}</a></li><li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li><ul></div>";
    
            }
    
            $counter++;
        }
        }
        else  {
        $output = '<ul class="wpp-list">';
        foreach( $mostpopular as $popular){
            $permalink = get_permalink($popular->id);
            $output .="<li><a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a></li>";
        }
        }
    
        return $output;
    }
    add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );

    and in index.php

    <?php wpp_get_mostpopular("range=weekly&limit=4&excerpt_length=150&stats_date=1&post_type='post'&stats_category=1"); ?>

    Thread Starter Amilus

    (@amilusc)

    Oh but the gif thumbnail problem being generated by wppp is fixed while using the costum_popular_post function…

    Thread Starter Amilus

    (@amilusc)

    Hi Hector,

    I’ve added the English version to all the exiting posts ( didn’t really have them all translated, but at least to the system now the English version exist and I’ll come back to do the real translation by editing the posts).

    However the same problem with wppp using costom_popular function still exisit, it does not function with wpml language switcher.

    The most popular posts stay in English regardless whichever language I switch to…

    Thread Starter Amilus

    (@amilusc)

    After adding the is_front_page part now the layout of wppp looks wonderful everywhere!

    But it doesn’t work with multi languages…which is very odd.
    I remember that it did function well in different language when I tested the costum_popular last time, and that’s why I noticed the excerpt length problem in kanji languages.
    I really can’t think of what is causing the problem.

    I will now add the english version to all the exiting posts and test wpp x wpml plug-in and will get back to you once it’s done.
    And again, thank you so much for everything…

    Thread Starter Amilus

    (@amilusc)

    Hi Hector,
    Not the excerpt but the language just doesn’t change in wppp after I added the costum_popular into function.php.

    Please see here:
    http://a-unefille.com/ja/
    http://a-unefille.com/zh-hant/

    The language in wppp stays English regardless which language of the site that I’m viewing.

    Thread Starter Amilus

    (@amilusc)

    P.S. Just noticed another issue that many of my exiting past posts were written in Chinese or Japanese instead of the default language English.

    As I start adding the English version of them, the duplicated wppp problem happens again.

    For the moment I start all new post by making the English post first (even just leave it blank), then the other languages, which should avoid the duplicate wppp problem. But For the exiting non-english posts (quite a lot), as I start to translate them into English, the duplication happens.

    Thread Starter Amilus

    (@amilusc)

    Hi Hector,

    Thank you!
    I just forwarded the gif thumbnail error informtation to HostGator and hope to hear back from them soon.

    I tested the custom thumbnail and the layout looked perfect, however
    1. The WPML multi-languages doesn’t function with the customised WPPP function code.
    It stays English regardless whichever language I switch to, so I couldn’t test if the excerpt code works well in Japanese and Chinese.

    2.After adding the custom wppp code into my function.php, not only the most popular section on the index but also the wppp widget on the sidebar in my single post page changes to the same layout, too.

    For the moment I simply added the wppp widget to the side bar and it looks like this:
    http://a-unefille.com/zh-hant/2014/12/05/royal-college-of-art-christmas-fete-2/
    (see the sidebar on the right)

    But adding the customised wppp code in function.php’d achieve the perfect layout in index.php but ruin the layout on single post page… Is there a way to solve this?

    Thank you so much for taking so much time on my massive problems…

Viewing 15 replies - 1 through 15 (of 33 total)