如果我将是该网站的建设者,这就是我将为“查看属于它们的公文包页面和图库”所做的:
1)我将创建一个新的页面模板,例如template-portfolio.php
在你的主题目录中,是这样的:
<?php
/*
Template Name: Portfolio
*/
if(is_user_logged_in() && current_user_can(\'manage_options\')) //ensure that it is an admin, as per requirements
{
global $current_user;
get_currentuserinfo(); //information shall be stored in $current_user
// echo \'User ID: \' . $current_user->ID . "\\n";
query_posts(array(\'Artists\' => $current_user->display_name));
//do the loop here.
}
else
{
wp_redirect(get_bloginfo(\'url\')); //go to home page if not logged in or if not admin
}
?>
2.)我会在wordpress中创建一个页面,并指定Portfolio作为页面模板
3)我会使用页面预览查看页面,如果可以,我会拍拍自己的后背;)
您可以在这里为您的其他关注点执行流程的变体。