wpmhweb
Forum Replies Created
-
Forum: Plugins
In reply to: [Ad Inserter - Ad Manager & AdSense Ads] Ad insertion within list of stepsIt’s not working. It inserts an ad on any ol li it finds, I need to insert only one after the first h2 in the post. Also, testing the above suggestion will loop and insert an ad after every li inside a ol tag, meaning if the guide has 5 steps, then I see 5 ads under each step.
Any other suggestions?
Thanks,Forum: Reviews
In reply to: [Ad Inserter - Ad Manager & AdSense Ads] Good plugin. Works as advertised!Specific features I need that are not available with this plugin.
Forum: Fixing WordPress
In reply to: Only resize when uploading featured imageThanks,
I’ll give this plugin a try and I’ll let you know the result.Thank you (@alchymyth and @sterndata).
The final code, which works, looks like this:
add_filter( 'body_class', 'custom_class' ); function custom_class( $classes ) { if ( is_tag() && !is_paged() ) { $classes[] = 'home-tag'; } elseif ( is_category() && !is_paged() ) { $classes[] = 'home-category'; } elseif ( is_page_template('all.php') && !is_paged() ) { $classes[] = 'home-paged'; } else { } return $classes; }Thanks,
Forum: Plugins
In reply to: [WP Popular Posts] How do I display popular post from tags, not cats?Thank you very much. I’ve wanting to do this for a long time.
Forum: Plugins
In reply to: [WP Popular Posts] How do I display popular post from tags, not cats?In the homepage, i’m using something like this:
<?php $args = array( 'range' => 'weekly', 'freshness' => 1, 'order_by' => 'views', 'limit' => 3, 'post_type' => 'post', 'stats_author' => 1, ); if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular( $args ); ?>Now I just need to do something similar but to show the popular post for a tag, not a category.
Thanks,
Forum: Plugins
In reply to: [W3 Total Cache] How to temporarily disable W3 Total Cache?no one?
Forum: Plugins
In reply to: [W3 Total Cache] W3 Total Cache causing Google Adsense to appear unreliablyWhen using W3 Total Cache always one or two ads (from Google or other networks) don’t show up, but if I reload the page a few times and delete the browser cache the I can all the ads.
If I clear the W3 Total Cache cache and delete the browser cache, then I can see the ads again, but after a while the problem happens over and over.Forum: Plugins
In reply to: [W3 Total Cache] Adsense ads strange behaviourI am having the exact same issue. Though, I don’t like it, I’m glad, I’m not the only one.
Hopefully they patch this issue soon.Thanks 🙂
The first solution is what I’ve been using, but unfortunately as you also said it doesn’t achieve what I’m trying to do.
Now for the second solution, will this be something that I need to write in the functions.php file? Or where do I need to define them?Thanks,
Forum: Plugins
In reply to: [WP Popular Posts] How to display alternative post titleNever mind,
I think I got it,if ($the_title_custom = get_post_meta($popular->id, 'field_alt_title', true)) { $the_title_custom = $the_title_custom; } else { $the_title_custom = $popular->title; }- This reply was modified 9 years, 11 months ago by wpmhweb.
Forum: Plugins
In reply to: [WP Popular Posts] How to display alternative post titleHello,
I’m not an expert, so it seems I can’t see to figure this out.
I got the wpp hook working, but when try to add the alternative title function it doesn’t work.This is technically what I need:
If post has alternative title,
then show the alternative title,
if not, then show the original title.This is the function I’m been trying to create
function get_my_custom_title($post_id){ // Get post data $the_post = get_post( $post_id ); // Get post_content $the_title_custom = $the_post->the_title; if ($the_title_custom = get_post_meta($post->id, 'field_alt_title', true)) { echo $the_title_custom; } else { get_the_title(); } $the_title_custom = $the_title_custom; return $the_title_custom; }Inside the function my_custom_popular_posts_html_list, this is what I’ve got:
function my_custom_popular_posts_html_list( $mostpopular, $instance ){ $output = '<ol class="wpp-list new">'; // loop the array of popular posts objects foreach( $mostpopular as $popular ) { $excerpt = ''; // Excerpt placeholder // Excerpt option checked, build excerpt tag if ( $instance['post-excerpt']['active'] ) { $excerpt = get_excerpt_by_id( $popular->id ); if ( !empty( $excerpt ) ) { $excerpt = '<div class="wpp-excerpt">' . $excerpt . '</div>'; } } $the_title_custom = get_my_custom_title($popular->id); if ( !empty( $the_title_custom ) ) { $the_title_custom = $the_title_custom; } $output .= "<li>"; $output .= "<a href=\"" . get_the_permalink( $popular->id ) . "\" title=\"" . esc_attr( $popular->title ) . "\"><h2 class=\"entry-title\">" . esc_attr( $the_title_custom ) . "</h2>"; $output .="<div>" . get_the_post_thumbnail( $popular->id ) . "</div>"; $output .= $excerpt; $output .= "</a></li>" . "\n"; } $output .= '</ol>'; return $output; } add_filter( 'wpp_custom_html', 'my_custom_popular_posts_html_list', 10, 2 );Any help will be much appreciated!
Thanks,
Forum: Plugins
In reply to: [WP Popular Posts] How to display alternative post titleAmazing,
I didn’t know about the hooks, it seems that it’s actually what I need.Thanks
PS: Awesome work with WPP, keep up the great work.Forum: Requests and Feedback
In reply to: Petition to remove the Inline Linking tool from WP 4.5Having the same issue as @hollyjahangiri hope this gets fixed soon.
Thanks,