Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #583993
    #584026

    to show a different menu for logged-in logged-out users there is a php way via child-theme functions.php

    you make two menus (the one for non logged in users and the other one) i called them main menu (for logged out users) and main menu logged (for logged in users). The one for logged out users i checked for main navigation

    function my_wp_nav_menu_args( $args = '' ) {
    
    if( is_user_logged_in() ) { 
    	$args['menu'] = 'main menu logged';
    } else { 
    	$args['menu'] = 'main menu';
    } 
    	return $args;
    }
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

    but this only hides the pages links in your menu – if you want a restriction there are a lot of plugins – but i did not find one easy to use
    Eyes only or page restrict etc. role scoper .
    But i don’t like to test it now.

    #584044

    :lol: this seems to do it (even hide the menu list point by setting up only one mark in that (page/post)

    Take this solution and forget the one before!

    https://de.wordpress.org/plugins/secret-content/

    but ( it only works for post and pages – i will try to extend it to custom post (like portfolio posts) )

    • This reply was modified 8 years, 10 months ago by Guenni007.
    #584071

    hm it seems to be to easy ! ?

    goto plugin editor and open – choose secret content and only ad that meta box for portfolio:

    add_meta_box(
            'secret_sectionid',
            _x( 'Show this to logged in visitors only?', 'Headline for checkbox / activation on portfolio', 'secret_textdomain' ),
            'secret_render_meta_box_content',
            'portfolio',
            'side',
            'high'
        );

    so it looks afterwards at the top in this way:

    function secret_meta_box() {
        add_meta_box(
            'secret_sectionid',
            _x( 'Show this to logged in visitors only?', 'Headline for checkbox / activation on posts', 'secret_textdomain' ),
            'secret_render_meta_box_content',
            'post',
            'side',
            'high'
        );
            add_meta_box(
            'secret_sectionid',
            _x( 'Show this to logged in visitors only?', 'Headline for checkbox / activation on portfolio', 'secret_textdomain' ),
            'secret_render_meta_box_content',
            'portfolio',
            'side',
            'high'
        );
        add_meta_box(
            'secret_sectionid',
            _x( 'Show this to logged in visitors only?', 'Headline for checkbox / activation on pages', 'secret_textdomain' ),
            'secret_render_meta_box_content',
            'page',
            'side',
            'high'
        );
    }

    then the plugin works too for portfolio entries !

    • This reply was modified 8 years, 10 months ago by Guenni007.
    #584077

    for the login. you can use a plugin like: https://wordpress.org/plugins/sidebar-login/
    And for the members you can choose only subscribers – that is enough.

    #584498

    Hi @realit-treuhand,

    Did you try @Guenni007’s suggestions and did you have any luck with them?

    Regards,
    Rikard

    #584547

    Hey thanks for the many answers. I am now using the password protected page option.
    How can I edit/change the text with its font family and size?
    Is it possible to still have the navigation bar shown and even a header photo? Also the socket should be the same size as on all the other pages.

    example page

    example page

    Regards,
    Aline

    #584881

    the password protected page option ?

    <smh>

    i try to find a solution which fits perferct for you.
    there was only one marker to set on each page/post/portfolio – if the marker is set only logged-in users see those posts including those related menu entries. Even in masonry and sidestep blog navigation only logged in users can see those marked entries.

    #586235

    Hi!


    @guenni007
    Thanks for your help! :)

    Please add following code to Functions.php file in Appearance > Editor

    function custom_password_form() {
    global $post;
    $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
    $o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">' . __( "You can write your own text here" ) . '
    <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    </form>
    ';
    return $o;
    }
    add_filter( 'the_password_form', 'custom_password_form' );

    Cheers!
    Yigit

    #591423

    Hey Yigit

    I’ve already done that and was able to change the text but I wouldn’t know where to insert the the font-family and size. More important though: How can I make the socket smaller, like on all the other pages? I’d also like to show the fullwidth header photo with its navigation bar and in the main content the password form should show up.

    Is this possible?

    Thanks for the help.
    Aline

    #594305

    Hey!

    Sorry for the late reply!
    Please add following code to Quick CSS in Enfold theme options under General Styling tab

    form.post-password-form p {
        font-size: 20px;
        font-family: arial;
    }
    #socket .container {
        padding-top: 0;
        padding-bottom: 0;
    }

    Please post a screenshot and show the changes you would like to make regarding “fullwidth header photo”. You can upload your screenshots on imgur.com or Dropbox public folder and post the links here.

    Cheers!
    Yigit

    #613682

    I’ve done that but whether the size nor its font family changed, I’ve even tried adding !important.
    This is what it looks like now:

    password protected site

    I need the text at least the same size as “Passwort” and the socket shouldn’t be that big, actually it should just be at the bottom like on all my other pages. Also a little space between the text and “Passwort” would be good. Can I also change the background color of the button? as well as size and font family of its text.

    Thanks.

    #616040

    Hi!

    Use this for the text:

    .post-password-form {
        font-family: open sans!important;
        font-size: 14px!important;
        font-weight: bold;
    }

    Apply a minimum height to the main container in order to push the socket container:

    #main > div + div {
        min-height: 600px;
    }

    Cheers!
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.