布兰登,
以下是您如何在一个SEO包中实现这一点:
<?php
if( $city ){
$args = array(
\'post_title\' => $city . " Electrician",
\'post_name\' => $city . "-electrician",
\'post_date\' => $_SESSION[\'cal_startdate\'],
\'post_content\' => $citycontent,
\'post_status\' => \'publish\',
\'post_type\' => \'page\',
\'post_parent\' => 11192
);
$city_id = wp_insert_post($args);
add_post_meta( $city_id, \'_aioseop_title\', $city . " Electrician" );
add_post_meta( $city_id, \'_aioseop_description\', $citycontent );
add_post_meta( $city_id, \'_aioseop_keywords\', \'city, electricians\' );
}
我只是在这里选择了一些示例值,但这些是所有搜索引擎优化包在帖子/页面等上使用的postmeta键。希望这能有所帮助!