您可以通过获取当前用户的成员级别并基于此设置条件来实现这一点。由于我没有wishlist成员的许可证,这是未经测试的。
我想是吧$member_id
与登录用户的WordPress ID值相同。
<?php
global $current_user;
get_currentuserinfo();
$member_id = $current_user->ID;
include(\'wlmapiclass.php\');
$api = new wlmapiclass(\'http://yourblog.com/\', \'yourAPIKey\');
$api->return_format = \'php\'; // <- value can also be xml or json
$membership = $api->get( /members/{$member_id} );
$membership = unserialize( $membership );
print_r( $membership ); // see in which value the actual ID or slug of the membership is stored, I cannot reproduce that..
?>
正如TomJNowell指出的,将include改为
get_header( $membershiplevel );
所以你很适合未来的会员级别。