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

    I have used the below code in a Drupal site, of course had help with it there, but would like to insert in header and convert the coding over to WordPress, please help…

    <!-- begin upper_section for customized login -->
    <div class="upper_section">
    <div id="user_links">

    <ul><?php global $user; if ($user->uid != 0) { print '<li class="first">' .t('Logged in as '). '<a>uid). '">' .$user->name. '</a>'; print '

    <li><a href="' .url('user/Logout'). '">' .t('Logout'). '</a></li>
    '; } else { print '<li class="first"><a href="' .url('user'). '">' .t('Login'). '</a>'; print '<li class="phone">1-XXX-XXX-XXXX'; } ?></ul>
    </div>
    </div>
    <!-- end upper_section for customized login -->

    #116710

    Hi,

    I have no experience on Drupal. Let me tag the rest of the support team. Maybe, you could hire a freelance developer to help you out.

    Regards,

    Ismael

    #116711

    Hi,

    This code is the equivalent of what you currently have when you login and get the admin bar on top, which states your user name in upper right hand corner as well as show the logout button. There is also a meta widget, Appearance > WIdgets, which will show a login option in the sidebar you place it in.

    Am I understand this issue correctly?

    I always wanted to check out Drupal, what would you say is its main strength and weakness compared to WordPress?

    Thanks,

    Nick

    #116712
    #116713

    OK.. I would like to remove the top bar per my selection (restrict to the users of my choice). Remove access to the dashboard as well. I would like to (or I will have to figure it out) I would like to use the login-logout feature I mentioned about. You can see what I am talking about here on the Drupal site I was working on before I saw the light and started to use WordPress.. :)

    http://www.thetrialconcepts.com/

    You will see what I am talking about in the upper right of your browser.

    #116714

    Nick,

    Drupal is touted as a CMS I think that is why it has a little more exposure than WordPress which it touted as a Blog web software. WordPress to me is a lot more sleeker than Drupal. The features that are in WordPress far out weigh the things that Drupal has. One thing that Drupal does have is downloadable documentation which I really like, online is such a pain to deal with.

    If you want, I can give you access to the Drupal site I have so you can poke around some and see what is up.

    #116715

    Hi sfranks12,

    You can use the login url code here: http://codex.wordpress.org/Function_Reference/wp_login_url

    The dashboard restrictions and such however would need to be handled by a plugin.

    Regards,

    Devin

    #116716

    I tried this, I put it in the header.php file:

    <div class="upper_section">
    <div id="user_links">
    <ul><?php

    if ( ! is_user_logged_in() )
    { echo $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>'; }
    else
    { echo $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>'; }
    if ( $echo )
    { echo apply_filters('loginout', $link); }
    else
    { return apply_filters('loginout', $link); }
    ?></ul>
    </div>
    </div>

    Would this work?? I do not see anything though…

    #116717

    OK.. I scraped the above and will use this instead… less coding and easier to do:

    <!-- begin upper_section for customized login -->
    <div id="header-sub-links">
    <div class="menu-header-links-container"><ul id="menu-header-links" class="header-links"><li><a href="http://http://0183818.netsolhost.com/wordpress1/e-discovery-beat/" >Blog</a></li>
    <li><a href="http://http://0183818.netsolhost.com/wordpress1/contact-us/" >Contact Us</a></li>
    </ul></div> <span>1-877-649-4LAW</span>
    </div>
    <!-- end upper_section for customized login -->

    I put this in the header.php right after <div id=”head”> Is this the correct place to put this so it will show up on every page and will be at the upper most right hand corner?

    #116718

    Hi,

    Yes you can add them on the header.php. Maybe you can place it at the bottom of this code.

    <h1 class="logo ie6fix <?php echo $logoclass; ?>"><a href="<?php echo get_settings('home'); ?>/"><?php echo $logo; ?></a></h1>

    I took the liberty to fix the styling a little to get your started. You can place this code at the very bottom of style.css.

    #header-sub-links ul {
    float: right;
    display: block;
    border: none;
    }

    #header-sub-links ul li {
    display: inline;
    border: none;
    background: none;
    }

    #header-sub-links ul li a {
    border: none;
    }

    #header-sub-links span {
    right: 0;
    position: absolute;
    top: 20px;
    }

    Regards,

    Ismael

    #116719

    Tried it does not work, SOooo.. I went with some a lot easier to do, I hope..

    Here is the code:

    <!-- begin upper_section for customized header info -->
    <div class="upper_section">
    <div id="user_links">
    <ul><li class="first"><a href="/contact-us">Contact Us</a></li><li class="phone">1-XXX-XXX-XXXX</li></ul>
    </div>
    </div>
    <!-- end upper_section for customized header info -->

    I placed it below where you mentioned above.

    Here is the CSS info for it:

    /* begin header section for customized header info - added 050113 */
    #header .upper_section{
    width:940px;
    margin:0 auto;
    height: 25px;
    }

    #user_links {
    float: right;
    top: 0px;
    right: 10px;
    background: #d4d0c8;
    padding: 0 15px;
    border-radius:0 0 10px 10px;
    -moz-border-radius: 0 0 10px 10px;
    -webkit-border-radius: 0 0 10px 10px;
    -khtml-border-radius: 0 0 10px 10px;
    }

    #user_links ul {
    display: inline;
    }

    #user_links ul li {
    margin: 0 10px 0 0;
    padding: 0 0 0 10px;
    display: inline;
    list-style: none;
    border-left: 1px #5a5a5a solid;
    background-image: none;
    }

    #user_links ul li.first {
    border: 0;
    color: #4a4a4a;
    }

    #user_links ul li.phone {
    color: #4a4a4a;
    }

    #user_links ul li, #user_links ul li a {
    font-size: 11px;
    line-height: 23px;
    }

    #user_links a.feed-icon {
    padding-right: 20px;
    }
    /* end customized user links in header */

    Any ideas why it is not working?? Thanks for your help if I did not mention it already..

    #116720

    OK.. I am dropping this so we can close this topic… Thanks for everyone’s help…

    #116721

    Hey,

    Glad you finally fixed it.

    Regards,

    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘Need help translating to WordPress’ is closed to new replies.