This topic has 1 reply, 2 voices, and was last updated 11 years by SQadmin.

  • Author
  • #1193
     MarkNilsson
    Participant

    Hi.
    Is it possible to have a frontpage to people who arent signed in and a frontpage to people that have signed in.
    I was thinking of a frontpage similar to yours to people who arent signed in and a frontpage with a overview over blogs and forum?

    #1197
     SQadmin
    Keymaster

    Hello,
    You can do this using only one Home page but to put conditions on the content to show.
    I have created for you 2 new shortcodes that we will also include in our next update.
    Add the following lines to your functions.php:

    COPY CODE
    
    /*-----------------------------------------------------------------------------------*/
    /*	Restrict content
    /*-----------------------------------------------------------------------------------*/
    
    if (!function_exists('kleo_only_members')) {
        function kleo_only_members( $atts, $content = null ) {
            if (is_user_logged_in()) {
                return do_shortcode($content);
            } else {
                return '';
            }
        }
        add_shortcode('kleo_only_members', 'kleo_only_members');
    }
    
    if (!function_exists('kleo_only_guests')) {
        function kleo_only_guests( $atts, $content = null ) {
            if (!is_user_logged_in()) {
                return do_shortcode($content);
            } else {
                return '';
            }
        }
        add_shortcode('kleo_only_guests', 'kleo_only_guests');
    }
    

    Use them like this in your page:

    COPY CODE
    
    [kleo_only_members]Content only for members[/kleo_only_members]
    
    [kleo_only_guests]Content only for guests[/kleo_only_guests]
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?