基于this previous WPSE question:
我尝试限制10个文件,但没有成功:
if ( count( get_posts( "post_type=attachment&post_parent={$post_id}" ) ) > 10 )
如何将其限制为10幅图像?谢谢
基于this previous WPSE question:
我尝试限制10个文件,但没有成功:
if ( count( get_posts( "post_type=attachment&post_parent={$post_id}" ) ) > 10 )
如何将其限制为10幅图像?谢谢
给你:
get_posts(array(\'post_type\'=>\'attachment\', \'numberposts\' => 10, \'post_parent\' => $post_id));
这将返回最多10个帖子。我在获取图像时获得404状态,http仍然包含该图像。图像显示在浏览器中,但404代码中断了一些应用程序。对wp内容/上载/的调用被重定向到。htaccess:<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\\.php$ - [L] RewriteRule (.*) /index.php?getfile=$1 [L] </IfModule>&