Theme Functions
-
I am using WP-Members plugin and am wanting to add some hooks to the themes function.php, but unable to do so so that I can use the short codes for the plugin. Where do I put these hooks. They look like this.
add_filter( ‘wpmem_member_links’, ‘my_member_links’ );
function my_login_redirect()
{
// return the url that the login should redirect to
return ‘https://beerandwineconnoisseurs.com/?page_id=104’;
}
add_filter( ‘wpmem_member_links’, ‘my_member_links’ );
function my_member_links( $links )
{
// get the current_user object
global $current_user;
get_currentuserinfo();// format the date they registered
$regdate = strtotime( $current_user->user_registered );// and the user info
$str = ‘<div id=”theuser”>
<h3 id=”userlogin”><span style=”color: white”>’ . $current_user->user_login . ‘</span></h3>
<div id=”useravatar”>’ . get_avatar( $current_user->ID, ’82’ ) . ‘</div>
<dl id=”userinfo”>
<dt>Member Since</dt>
<dd>’ . date( ‘M d, Y’, $regdate ) . ‘</dd>
<dt>Location</dt>
<dd>’
. get_user_meta( $current_user->ID, ‘city’, true )
. ‘, ‘
. get_user_meta( $current_user->ID, ‘thestate’, true )
. ‘</dd>
<dt>Subscription</dt>
<dd>’
. get_user_meta($current_user->ID, ‘month_subscription’, true )
. ‘</dd>
</dl>
</div>
<hr />’;// tag the original links on to the end
$string = $str . $links;// send back our content
return $string;
}
add_filter( ‘wpmem_logout_redirect’, ‘my_logout_redirect’ );function my_logout_redirect()
{
// return the url that the logout should redirect to
return ‘https://beerandwineconnoisseurs.com/’;
}
I have added this to other functions.php, but can not find where to add in the picture-perfect theme
- The topic ‘Theme Functions’ is closed to new replies.