Title: dtszero's Replies | WordPress.org

---

# dtszero

  [  ](https://wordpress.org/support/users/dtszero/)

 *   [Profile](https://wordpress.org/support/users/dtszero/)
 *   [Topics Started](https://wordpress.org/support/users/dtszero/topics/)
 *   [Replies Created](https://wordpress.org/support/users/dtszero/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/dtszero/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/dtszero/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/dtszero/engagements/)
 *   [Favorites](https://wordpress.org/support/users/dtszero/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Lazy Load for Comments] Not working with Google recaptcha](https://wordpress.org/support/topic/not-working-with-google-recaptcha/)
 *  [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/not-working-with-google-recaptcha/#post-11066614)
 * You need to explicit render the recaptcha after load the comments
    [https://developers.google.com/recaptcha/docs/display#render_param](https://developers.google.com/recaptcha/docs/display#render_param)
 * I’m using now this plugin with recaptcha v2 😉
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Autoptimize] Redirection loop with 2.4.1](https://wordpress.org/support/topic/redirection-loop-with-2-4-1/)
 *  [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/redirection-loop-with-2-4-1/page/2/#post-10800212)
 * Hi have the same problem but only in 1 site of 3.
 * The code is
 *     ```
       /** Autoclean Autoptimize */
       if (class_exists('autoptimizeCache')) {
           $myMaxSize = 350000; // 100000 = 100MB
           $statArr=autoptimizeCache::stats(); 
           $cacheSize=round($statArr[1]/1024);
   
           if ($cacheSize>$myMaxSize){
              autoptimizeCache::clearall();
              header("Refresh:0"); // Refrsh cache
           }
       }
       ```
   
 * When the cache are bigger than the limit my wordpress enter in a update loop.
 * But I have the same snippet in other sites but I only have problems with one.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Custom Post Types templates not loaded](https://wordpress.org/support/topic/custom-post-types-templates-not-loaded/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-post-types-templates-not-loaded/#post-10799173)
 * The child theme tutorial is perfect, thanks!
 * Regards,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Show multiple Post Types in homepage](https://wordpress.org/support/topic/show-multiple-post-types-in-homepage/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/show-multiple-post-types-in-homepage/#post-10792415)
 * I found an article on your blog, [https://ampforwp.com/tutorials/article/modify-homepage-posts-loop-amp-version-right-way/](https://ampforwp.com/tutorials/article/modify-homepage-posts-loop-amp-version-right-way/)
 * I leave a part of the your code:
 *     ```
       <?php
       /*
       Plugin Name: AMP Home Page Modify
       Version: 0.0.1
       Author: Mohammed Khaled
       Author URI: https://ampforwp.com/
       Donate link: https://www.paypal.me/Kaludi/5
       License: GPL2
       */
       // Exit if accessed directly.
       if ( ! defined( 'ABSPATH' ) ) exit;
   
       //Use Case 2: Show posts from different Post types
       function ampforwp_return_loop_args(){
           // learn more to Modify args @ https://developer.wordpress.org/reference/classes/wp_query/
           //remove code between these comments and replace with your code here
         $q = array(
                   'post_type'           => array( 'post', 'custom_1', 'custom_2' ),
                   'orderby'             => 'date',
                   'ignore_sticky_posts' => 1,
                   );
           return $q;
       }
       function ampforwp_custom_home_output(){
         add_filter('ampforwp_query_args', 'ampforwp_return_loop_args');
       }
       add_action('amp_init','ampforwp_custom_home_output');
       ```
   
 * Thanks! I solve this,
 * Regards,
    -  This reply was modified 7 years, 7 months ago by [dtszero](https://wordpress.org/support/users/dtszero/).
      Reason: ; fix
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Show multiple Post Types in homepage](https://wordpress.org/support/topic/show-multiple-post-types-in-homepage/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/show-multiple-post-types-in-homepage/#post-10792375)
 * Hi [@marqas](https://wordpress.org/support/users/marqas/),
 * Yes I have 4 custom post types and I want to show all of this with the WordPress
   default ‘post’ on my homepage.
 * In my normal theme I use this code to show up all
 *     ```
       // Show on home
       function print_ani_man_posts($query) {
         if( !is_admin() && $query->is_main_query() && is_home() ) {
           $query->set('post_type', array('post', 'anime', 'manga', 'pelicula', 'ova'));
         }
       }
       add_action('pre_get_posts', 'print_ani_man_posts');
       # Show on home
       ```
   
 * But isn’t working with AMP.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Bug – Incorrect category on quick edit post](https://wordpress.org/support/topic/bug-incorrect-category-on-quick-edit-post/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years ago](https://wordpress.org/support/topic/bug-incorrect-category-on-quick-edit-post/#post-10311389)
 * Thanks for the reply 🙂
 * I looked into you core examples of github and I found a manual code for check
   this:
 *     ```
       // SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
       function patch_primary_cat($id){
         $category = get_the_category($id);
         $useCatLink = true;
       	if ($category){
       		$category_link = '';
       		if ( class_exists('WPSEO_Primary_Term') ){
       			// Show the post's 'Primary' category, if this Yoast feature is available, & one is set
       			$wpseo_primary_term = new WPSEO_Primary_Term( 'category', $id );
       			$wpseo_primary_term = $wpseo_primary_term->get_primary_term();
       			$term = get_term( $wpseo_primary_term );
       			if (!is_wp_error($term)) {
       			  // Yoast Primary category
       			  $category_link = get_category_link( $term->term_id );
       			  return $category_link;
       			}
       		}
       	}
       }
       ```
   
 * I’m not sure if isn’t pretty but is working for me. Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Auto Affiliate Links] Compatibility with ACF](https://wordpress.org/support/topic/compatibility-with-acf-4/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-acf-4/#post-10010943)
 * It’s works fine!
 * Thanks for the support.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Auto Affiliate Links] Compatibility with ACF](https://wordpress.org/support/topic/compatibility-with-acf-4/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-acf-4/#post-10009408)
 * Hi [@thedark](https://wordpress.org/support/users/thedark/)!
 * Today I look into my code for add the ACF and I apply a filter directly on the
   content, so can I send the “new content” to the Auto Affiliate plugin?
 * This is the code that I used
 *     ```
       add_filter( 'the_content', 'wpse241388_use_acf_field' );
       function wpse241388_use_acf_field( $content ) {
           if ( is_singular( 'article' ) ) {
               $content = get_field( 'article_text' );
           }
           return $content;
       }
       ```
   
 * [https://wordpress.stackexchange.com/questions/241388/replace-posts-the-content-with-acf-value](https://wordpress.stackexchange.com/questions/241388/replace-posts-the-content-with-acf-value)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Auto Affiliate Links] Compatibility with ACF](https://wordpress.org/support/topic/compatibility-with-acf-4/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-acf-4/#post-10000093)
 * Thanks for the reply! I’ll wait for that.
 * Regards,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PB SEO Friendly Images] How can I exclude a certain page?](https://wordpress.org/support/topic/how-can-i-exclude-a-certain-page/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/how-can-i-exclude-a-certain-page/#post-9841149)
 * Thanks! It works 10/10.
 * I’ll mark as resolved and save the code for the future.
 * Regards,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Post redirect to tag](https://wordpress.org/support/topic/post-redirect-to-tag/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/post-redirect-to-tag/#post-9752416)
 * Hi [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * I migrated from php 5.6 to php 7 and the error has fixed.
 * If you look the past screenshots the post redirect me to a tag but when I use
   the post preview on the panel editor all the content shows fine.
 * But with php 7 I don’t have the same error.
 * Honestly I don’t know what was the bug with php 5.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Change image of posts on homepage](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/#post-9715592)
 * I “resolved it” adding the size manually:
 *     ```
       $thumb_url_ext = substr($thumb_url, -4);
       $thumb_url = (substr($thumb_url, 0, -4) . "-270x180");
       $thumb_url = $thumb_url . $thumb_url_ext;
       ```
   
 * But maybe the best way it’s to add a “thumbnail” default size on the panel. Because
   for PageSpeed 600×300 is too much.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Change image of posts on homepage](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/#post-9710573)
 * Or adding the size to the end of the img source works?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[AMP for WP - Accelerated Mobile Pages] Change image of posts on homepage](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/)
 *  Thread Starter [dtszero](https://wordpress.org/support/users/dtszero/)
 * (@dtszero)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/change-image-of-posts-on-homepage/#post-9695953)
 * Hi [@ahmedkaludi](https://wordpress.org/support/users/ahmedkaludi/)
 * Thanks for your reply.
 * I’m uploading a 600×300 image in each post, and I generate a 270×180 thumbnail
   for the amp homepage.
 * I’m was viewing the code of the index.php of the template 3, and I want to change
   the thumbnail size when you use this function ‘ampforwp_get_post_thumbnail’
 * I alredy tried with ‘get_the_post_thumbnail($post->ID, array(270,180) );’ and
   get_the_post_thumbnail($post->ID, ‘post-thumbnail’ );
 * But either work. How can I change the return feature image size?
 * `accelerated-mobile-pages/templates/design-manager/design-3/index.php`

Viewing 14 replies - 1 through 14 (of 14 total)