在我的模板中,在函数文件中,开发人员创建了一个代码,用于在主页上显示各种博客(wp mu)的最后帖子。我想通过显示页面代替帖子来编辑代码。
我将显示部分代码,其中我认为有必要将单词post替换为page。
你能帮我找出在哪里以及如何找到吗?谢谢
add_shortcode( \'newswpmu\', \'newswpmu_func\' );
function newswpmu_func( $atts, $content = null ) { // New function parameter $content is added!
global $post;
extract( shortcode_atts( array(
\'title\' => \'blog title\',
\'blogid\' => 1,
\'format\' => 3,
\'show\' => 3,
\'sortby\' => "lastest",
\'exlength\' => 100,
\'meta\' => "",
\'readmore\' => \'disabled\',
\'seeall\' => \'enabled\',
\'seeall_link\' => \'\',
\'seeall_text\' => \'see all\',
\'classes\' => \'\',
\'format_medium\' => 2,
), $atts ) );
$content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content
//print_r($post);
(…)
// show list articles
wp_reset_query();
switch_to_blog($blogid);
$my_query = new WP_Query(\'showposts=\'.$show.\'&orderby= \' . $orderby . \'&order=\' . $order);
$articlecount = 0;
$articlecontent = "";
$get_meta_content = "";
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
$articlecount ++;
$thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), \'full\');
$image_url_small = str_replace(".jpg", "-350x175.jpg", $thumb_url[0]);
$image_url_big = str_replace(".jpg", "-600x300.jpg", $thumb_url[0]);
(…)
$articlecontent .= \'
<article class="post-item post-\' . get_the_ID() . \' post type-post status-publish format-standard has-post-thumbnail" itemscope="" itemtype="http://schema.org/Article">
<meta itemprop="datePublished" content="\' . get_the_date(get_option(\'date_format\')) . \'">
<div class="gp-post-thumbnail featured-content image-above">
<a href="\' . get_the_permalink() . \'" title="\' . get_the_title() . \'">
<img src="\' . $image_url_small . \'" data-rel="\' . $image_url_big . \'" alt="\' . get_the_title() . \'" class="wp-post-image" itemprop="image" height="150" width="300">
</a>
</div>
<div class="post-item-content image-above">