A bit of Wordpress Trouble

Discussion in 'Integration' started by rebeccapryce, Jun 15, 2013.

  1. rebeccapryce

    rebeccapryce New Member

    Joined:
    Mar 1, 2013
    Messages:
    4
    I have Wordpress and aMember talking to one another, which is a great first step. But I have a comment.php file that asks the user log-in to Wordpress, not aMember. I'm new at this, but I believe the trouble lies in the following code:

    <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
    <p><?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'engine'), '<a href="'.get_option('siteurl').'/wp-login.php?redirect_to='.urlencode(get_permalink()).'">', '</a>') ?></p>
    <?php else : ?>

    Ideas anyone? I've been at it for hours, and it might take someone with a bit more experience a few seconds.
    Thanks...
  2. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    Don't worry about this file for the time being. What is the user doing when they are presented with a WordPress login page?
  3. rebeccapryce

    rebeccapryce New Member

    Joined:
    Mar 1, 2013
    Messages:
    4
    Grant,

    Thank you so much for replying.

    The first two on your list are done. The problem is, the code in my comments.php file is creating a Wordpress login link. That's what I'm trying to fix. I've even tried to fix this through an .htaccess file, but it created even more problems.

    My comments.php file creates a link to a Wordpress login with the following text, the link being 'logged in':
    "You must be logged in to post a comment."

    Rebecca
  4. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    This is not the way the integration should work. This link should point to the aMember login page without any other modifications. I suspect it is the way your theme is written. I use StudioPress's Genesis for all my sites and it works fine.

    I highly recommend that you stop modifying stuff and submit a ticket to aMember support so they can take a look. You could be creating more problems with this approach.
  5. rebeccapryce

    rebeccapryce New Member

    Joined:
    Mar 1, 2013
    Messages:
    4
    Yes, obviously, this is not the way integration should work. I bought DesignerTheme's Adapt, so I suspect you are right about it being unique to its code. However, my site is not live; I'm working on MAMP. So I'm not sure how much help a trouble ticket will be, which is why I posted a thread. Thank you for your time.
  6. gswaim

    gswaim CGI-Central Partner

    Joined:
    Jul 2, 2003
    Messages:
    641
    You can confirm if it is theme related by temporarily switching the site to one of the default WordPress themes (Twenty Eleven or Twenty Twelve) to see if it works correctly with them.
  7. rebeccapryce

    rebeccapryce New Member

    Joined:
    Mar 1, 2013
    Messages:
    4
    It definitely was the theme file. For anyone else with a similar issue, here is the fix. Pretty simple, actually. Hope it saves you time:

    Replace:

    p><?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'engine'), '<a href="'.get_option('siteurl').'/wp-login.php?redirect_to='.urlencode(get_permalink()).'">', '</a>') ?></p>

    With:

    p><?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'engine'), '<a href="YOUR AMEMBER LOGIN LINK HERE">', '</a>') ?></p>

    Good luck all.
  8. CrackBaby

    CrackBaby aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    154
    or just disable all comments by removing that code.

Share This Page