Recker
Forum Replies Created
-
Forum: Hacks
In reply to: Showing/Changing Menu Items with Login/LogoutNo, i’m wrong again! The cache hadn’t cleared and it was still showing an old link to account via role redirect.
Still haven’t managed to get it into a menu!
Forum: Hacks
In reply to: Showing/Changing Menu Items with Login/LogoutI’ve managed to get it partly working!: protipsters.co.uk
This is the code I’m using:
/*Add Modal Menu Login/Logout*/ function add_login_out_item_to_menu( $items, $args ){ //change theme location with your theme location name if( is_admin() || $args->theme_location != 'primary' ) return $items; if( is_user_logged_in( ) ) $link = '<a href="protipsters.co.uk/account" class="login">Account</a>'; else $link = '<a href="protipsters.co.uk/subscription" class="login">Subscribe Now</a>'; $redirect = ( is_home() ) ? false : get_permalink(); if( is_user_logged_in( ) ) $link = do_shortcode('[modal_login login_text="Members Login" logout_text="Logout" logout_url="/"]'); else $link = do_shortcode('[modal_login login_text="Members Login" logout_text="Logout" logout_url="/"]'); return $items.= '<li id="log-in-out-link" class="menu-item menu-type-link">'. $link . '</li>'; }add_filter( 'wp_nav_menu_items', 'add_login_out_item_to_menu', 50, 2 );The issue I’m having now is that the Subscribe Now/Account button is stuck on Account all the time. It doesn’t change name, but it does appear to do what it’s meant to do!
Forum: Hacks
In reply to: Showing/Changing Menu Items with Login/LogoutWhere would a javascript error log be found?
And I need the modal login/logout connected to the main menu. And it would be useful to have this to!Since I’m basically repeating code with a different layout, I don’t need this part again do i?
function add_login_out_item_to_menu( $items, $args ){ //change theme location with your them location name if( is_admin() || $args->theme_location != 'primary' ) return $items;Thanks for the help!
– JamieForum: Hacks
In reply to: Showing/Changing Menu Items with Login/LogoutI tried that, It just showed a black screen! Didn’t load any of the site.
Though it didn’t show any error code either, So It must be in the right direction!Forum: Plugins
In reply to: [WP Modal Login] i made something to use in the menu barWhat do I need to do if I want to keep the login_text/logout_text?
I need to changing the word just like the function you provided, but just linking to other pages rather than the shortcode.Sorry, I’m new to this 🙂
Forum: Plugins
In reply to: [WP Modal Login] i made something to use in the menu barSo that part of the code would simply be:
$link = http://www.mysite.com logout_url="/"]'); else $link = http://www.mysite.com logout_text="Uitloggen" logout_url="/"]');[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Is that correct?
Forum: Plugins
In reply to: [WP Modal Login] i made something to use in the menu barHey,
Thank you that worked perfectly!I was wondering if by any chance you knew how to tweak the code to do this:
If not logged in show ‘Link A’
When logged in show ‘link B’ in place,but rather then calling a shortcode it would be a page link.
I tried it myself but I caused my entire site to error and break.
So I thought I’d ask you!regards,
JamieForum: Themes and Templates
In reply to: Creating full page view for in Single Post modeWhat code am I looking for? This theme is coded much differently to others I have seen, I find navigating through it quite confusing!
I’ll link each below to save time!
Header.php
[Code moderated as per the Forum Rules. Please use the pastebin]Footer.php only had something to do with bottom widget which doesn’t affect what I need.
I hope you make more sense of it than I do, as most of it means nothing to me!Thanks again in advance!
Forum: Themes and Templates
In reply to: Creating full page view for in Single Post modeMy single.php contains:
<?php get_header(); include(THEME_LIB.'/template_posts.php'); get_footer(); ?>So, I’m guessing everything I need to chance would be in the template_posts.php?
I’m new to recoding of bits like this, so sorry in advance if I’m slow!