• Resolved etna32

    (@etna32)


    Hi
    When you see the protected posts on an archive page there is the text “You need to login to view this content. Please Login. Not a Member? Join Us” in each post.
    The issue here is that there are no links on “Login” and “Join Us”. If you click to go to the post the links are there.
    I think it is crucial to have the links on archive pages too, how can we do it?

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,
    I also stated that today and think it’s not crucial but very welcome ??
    The behavior applies not only to arcive lists, also to lists of recent posts for instance.
    Regards
    Knut

    • This reply was modified 4 years, 1 month ago by noesiskl.
    Plugin Support mbrsolution

    (@mbrsolution)

    @etna32,

    When you see the protected posts on an archive page there is the text “You need to login to view this content. Please Login. Not a Member? Join Us” in each post.
    The issue here is that there are no links on “Login” and “Join Us”. If you click to go to the post the links are there.
    I think it is crucial to have the links on archive pages too, how can we do it?

    I just finished carrying out a test in my dev site and everything is working as expected.

    For example: I went to the blog page and all the posts displayed in the blog page are protected. When I click on Join Us or Login links it takes me to the corresponding forms. So I can confirm this is working as expected. I suspect that you might have a conflict with your theme or a plugin. Please carry out the following troubleshooting steps.

    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    Let me know what happens.

    Thank you

    @mbrsolution Sorry, but there are no influences from other plugins or from the theme. I am convinced, it’s a bug in the SWPM code. At the moment, I didn’t yet found out, where.

    But I modified /wp-content/plugins/simple-membership/classes/class.swpm-access-control.php and inserted the following after line 48:
    echo '<p style="font-style:italic;">'.$error_msg.'</p>';.

    The result is, that in post list the ‘not logged-in message’ is shown twice: once with links (my extension, marked red) and after that the output of your plugin (without links).
    See screenshot: https://oc.ib-noesis.de/index.php/s/1M801FEgdJr6Zxb
    So my conclusion is, that something (wrong) happens in the process of displaying $this->lastError. ??

    Would you be so kind to track this and make an appropriate bug fix in the next release? Thanks in advance!

    Kind regards
    Knut

    • This reply was modified 4 years, 1 month ago by noesiskl. Reason: further information added
    Plugin Support mbrsolution

    (@mbrsolution)

    Hi Knut, thank you for sharing this information. I have submitted a message to the developers to investigate further your findings.

    Kind regards

    @mbrsolution Good news! I finally found the reason why in lists of posts the links are not present.

    The text of lastError is piped through the function wp_trim_words (/wp-includes/formatting.php, lines 3873..3916) and just right at the beginning there is a wp_strip_all_tags (line 3879).

    So my solution is to implement a hook (wp_trim_words), the function called by that is a copy of wp_trim_words, exept of two lines:
    $original_text = $text; becomes $text = $original_text (3878)
    and
    $text = wp_strip_all_tags( $text ); (3879) is commented out. ??

    This works for me, but: quick and dirty!
    A better (and the right) solution would be of cause:

    • check if the SWPM login link is present
    • skip wp_strip_all_tags only in that case

    Maybe your developers find this solution appealing as an implementation in SWPM… ??
    Kind regards
    Knut

    • This reply was modified 4 years, 1 month ago by noesiskl. Reason: typos
    Thread Starter etna32

    (@etna32)

    Hi,
    Yes it is that the WP does not allow HTML in the excerpt.
    With this link you can do it.
    But maybe you have a better solution w/o changing the functions.php

    • This reply was modified 4 years, 1 month ago by etna32.
    Plugin Author wp.insider

    (@wpinsider-1)

    If the theme is showing an excerpt on the archive page, then the links won’t work there. It’s how excerpt output of WP works. We prefer not to modify the default behavior of WP too much (to make sure this simple plugin doesn’t cause other issues). Better option is to use a theme that outputs the full text (instead of excerpt). Alternatively, try a different membership plugin which can work better with your current theme.

    @wpinsider-1 If one design the hook in a way that only the plain text snippets of login and join-us links are replaced with the corresponding links I can’t see any posibility of interference with themes and/or other plugins. By that, one can also use the $text (instead of $original_text) portion of the hook, which further prevents influences to existing (and desired/expected) behavior, because that is filtered already.

    @etna32 I think this topic can be marked as solved?

    Thread Starter etna32

    (@etna32)

    Yes I think it is solved

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘No links to login-Join us on Archive pages’ is closed to new replies.