lecreati
Forum Replies Created
-
Have a good night) for me is late too) Will play with it next week. Also have a great 4th of july
The funny part it works on English version but not on Dutch
It does show the name of the post but its sims don’t pick up the styling – no formating.
Why it could be?No problem. Thank you, Héctor
I customized the look of the aoutput and using Themer from Beaver Builder
here is my code:/** * Builds custom HTML. * * With this function, I can alter WPP's HTML output from my theme's functions.php. * This way, the modification is permanent even if the plugin gets updated. * * @param array $mostpopular * @param array $instance * @return string */ function my_custom_popular_posts_html_list( $popular_posts, $instance ){ $output = '<ul class="wpp-list">'; $post_number = 1; // loop the array of popular posts objects foreach( $popular_posts as $popular_post ) { $stats = array(); // placeholder for the stats tag // Author option checked if ( $instance['stats_tag']['author'] ) { $author = get_the_author_meta( 'display_name', $popular_post->uid ); $display_name = $author ; $stats[] = '<span class="wpp-author">' . sprintf( __( 'by %s', 'wordpress-popular-posts' ), $display_name ). '</span>'; } // Date option checked if ( $instance['stats_tag']['date']['active'] ) { $date = date_i18n( $instance['stats_tag']['date']['format'], strtotime( $popular_post->date ) ); $stats[] = '<span class="wpp-date">' . sprintf( __( 'posted on %s', 'wordpress-popular-posts' ), $date ) . '</span>'; } // Category option checked if ( $instance['stats_tag']['category'] ) { $post_cat = get_the_category( $popular_post->id ); $post_cat = ( isset( $post_cat[0] ) ) ? '<a href="' . get_category_link( $post_cat[0]->term_id ) . '">' . $post_cat[0]->cat_name . '</a>' : ''; if ( $post_cat != '' ) { $stats[] = '<span class="wpp-category">' . sprintf( __( 'under %s', 'wordpress-popular-posts' ), $post_cat ) . '</span>'; } } $output .= '<li><div class="popular_number">'.$post_number.'</div> <div class="popular_info"> <h2><a href="' . get_permalink( $popular_post->id ) . '" title="' . esc_attr( $popular_post->title ) . '">'. $popular_post->title .'</a></h1> <div class="autor-block-top"> <div class="autor-block-top_info-block"> <div class="autor-block-top_info-block_name">'. $display_name .'</div> </div> </div> </div> </li>'; $post_number++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'my_custom_popular_posts_html_list', 10, 2 );
and then add it with shortcode [wpp stats_author=1 stats_date=1 stats_date_format=’j M, Y’ post_html='<span>{thumb} {text_title} </span>’]
All the posts are translated (double-checked it now), if this is what you are referring, i don’t really care if the popularity counting is on the English side I just want it to show the right version
Hello, Sorry for the delay with answer. Yes we do have the firewall. can you tell the ip that plugin needs to connect with? so i can add the ip to trasted list?
Thk youThk you @sandyme