• I’m creating a wordpress site for a small Company and they want a login page where some clients can download upladed images and pdf files. Anyone knows how to do that?

Viewing 4 replies - 1 through 4 (of 4 total)
  • jessy

    (@jessy-marco)

    1, Download plugin USER ROLES
    2, Create “EMPLOYEE” role with custom capabilities
    3, In WP settings should set from subscribe to name of your role, because you want to register just your employees (custom role)
    4, There is another way: Make custom login form and set witch role will be assigned. (custom role)

    Thread Starter webb2014

    (@webb2014)

    Sorry I didnt really make myself clear when I asked that question, but what I need is something like this
    http://www.lotustravel.se/agent (when you click on Välkommen till Lotus Travels agentsida,you get directed to a login page)
    http://www.lotustravel.se/agents/

    And when they logged in they will be able to download pdf’s and images

    jessy

    (@jessy-marco)

    You can do it through shrotcode, where just the people who will registered/logged can view and download files. I will write it down for you in next day. You should learn new something about shortcodes, if you have time.

    jessy

    (@jessy-marco)

    Here is the shortcode:

    [download-link link="http://wordpress.org/latest.zip" name="Download Worpress"]

    Put this into the <strong>function.php</strong>

    <?php
    // Allow download file just to registered and logged users
    function download_file_shortcode($atts, $content = null) {
    extract(shortcode_atts(array(
          "span" => "4",
          "offset" => "",
    	  "title" => "",
    	  "link" => "",
    	  "name" => "Download File",
    	  "notice" => "If you want to download this file, you have to be logged-in!",
    ), $atts));
    ob_start();?>
    
    <div class="span<?php echo $span;?> offset<?php echo $offset;?>">
    <div class="download-file clearfix">
    <h3><?php echo $title; ?></h3>		
    
    <?php
    if ( is_user_logged_in() ) {
        echo '<a href="'.$link.'"">'.$name.'</a>';
    } else {
        echo $notice;
    }
    ?>
    
    </div> <!-- end of the download-file clearfix -->
    </div> <!-- end of the span offset -->
    
    <?php $output = ob_get_clean();
    return $output;
    }
    add_shortcode("download-link", "download_file_shortcode");
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Login page for certain users’ is closed to new replies.