• Resolved kckc

    (@kckc)


    I enabled the option, Forum Buttons>2. Activate Subscribe Button, to turn the subscribe to forum link into a button. The Button appears, with the text I want on it, but it does not work. It has no effect.

    The regular Subscribe/Unsubscribe options work ok.

    I am using Twenty-Seventeen theme.

    @jb510 I saw you had the same problem. Did you ever find a solution?

Viewing 8 replies - 31 through 38 (of 38 total)
  • codejp3

    (@codejp3)

    @fabienmahot777 – I was not able to replicate the subscription button issue. Using the following shortcodes, subscribe/unsubscribe was working fine:

    [bbp-forum-index]
    [bbp-single-forum id=##] (## was an actual forum ID)
    [bbp-topic-index]
    [bbp-single-topic id=##] (## was an actual topic ID)

    I tested against default WP twenty-x themes and against the “Spice Software Dark” theme. Working fine in all cases.

    One note is that with the shortcodes, the AJAX file is NOT loaded, so the page defaults to using the PHP functionality, which reloads the page to perform the actions. Not as elegant as no-page-reload AJAX, but it is functional.

    It does not appear to be an issue with bbPress core. Working as expected.

    Only things I can think of left to try to help you is:

    1.) On the page where you’re having the issue, right-click and select “view source code”. Then within the source code hit “ctrl” and “f” keys at the same time to “find a string” and search for “engagements.js”.

    If that file is not found, this simple code snippet could be added that would force-load it. It may fix your issue and should also enable AJAX functionality for subscriptions, favorites, and other bbPress actions when shortcodes are used:

    /*
    * Force-Load bbPress engagements.js script
    */
    function force_load_engagements_script() {
        wp_enqueue_script( 'bbpress-engagements-js', WP_PLUGIN_URL . '/bbpress/templates/default/js/engagements.js', array( 'jquery' ), ( function_exists( 'bbp_get_version' ) ? bbp_get_version() : get_bloginfo( 'version' ) ), false );
    }
    add_action( 'wp_enqueue_scripts', 'force_load_engagements_script' );

    ^ That should be added to your theme functions file ONLY if you’ve setup a proper child theme for “Spice Software Dark” so that it doesn’t get lost if there are any future updates for that theme. You could also add that code snippet with one of my favorite code plugins Code Snippets. Or you could get slightly more involved and write your own plugin to hold all of your custom code snippets.

    That code snippet above can be improved to target ONLY the bbPress pages you need engagements.js enqueued for, but you need to know those specific page slugs . You could wrap the wp_enqueue_script() with an additional check for those specific page slugs like this:

    /*
    * Force-Load bbPress engagements.js script on specific pages
    */
    function force_load_engagements_script() {   
        if ( is_page( [ 'custom-forum-index-page', 'custom-topic-index-page' ] ) ) {
            wp_enqueue_script( ... ); // NOTE: '...' used to simplify example code and must be replaced with actual enqueue code!
        }
    }
    add_action( 'wp_enqueue_scripts', 'force_load_engagements_script' );
    

    2.) If you send me the URL to the page where the problem exists, I can inspect it myself. You can post the link here or email it to me at [email protected]. I would need an account on your site so that the subscribe/unsubscribe button shows for me. It can be a regular user account without admin access. I would just inspect it, but not to do anything about it. Doing something about it would require admin access, and that’s not a good idea unless it’s a test/development site without anything important or any live users. Your site, your decision.

    There’s something not right with your server/site environment that I can’t replicate on my test server. It will take some digging to find out the root issue.

    fabienmahot777

    (@fabienmahot777)

    @codejp3 Thanks a lot for analyse. Yes sure i give the URL of my website : https://avenirdebizanoscyclo.fr/index.php/forums/forum/le-club/ and you can use the test user [email protected] and the password VilleBizanos2023!

    i’m going ton try to do what you explain in step 1

    codejp3

    (@codejp3)

    @fabienmahot777 – got a chance to look at it.

    Both “subscribe” and “favorite” are not working.

    If i right-click, “open in a new tab” they do work. But something is preventing them from reloading the page where they are displayed. It really does seem like a plugin or theme conflict.

    I will try every plugin you listed to see if one of them breaks it on my test site, but my settings will not match yours so there’s no guarantee that I can replicate it.

    I’m almost 100% sure it is a conflicting plugin or theme.

    You can disable/delete that test user account before people start spamming your forum ??

    codejp3

    (@codejp3)

    @fabienmahot777UPDATE: Read the last reply first.

    If you still have issues after fixing your permalink issues, then you can try the things mentioned in this reply

    ——————————————————————

    Here’s what I have active:

    Even with all of those plugins active, the buttons are still working fine for me.

    As you can see, I even tried French as the site language just to rule that out as a possible cause.

    Only things I can suggest are:

    1.) Try disabling EVERY plugin except for bbPress. Also disable the “Spice Software Dark” theme and enable a traditional default theme like twenty-twenty.

    It should ABSOLUTELY work then.

    If it still does not work, then there’s something not right with how you’re adding bbPress to the frontend of the site. In that case, I’d suggest:

    2.) Not embedding the forum with the the bbp-forum-index and bbp-topic-index shortcodes. Instead, just use the default permalinks that bbPress uses by default. I didn’t see any specific need for you to use those shortcodes anyway. The default permalinks should be fine for your needs. You do not need to create pages for

    It should ABSOLUTELY work then.

    If it still does not work, then there’s something not right with your hosting server configuration. You may need to contact the hosting provider/server admin to look into it.

    • This reply was modified 2 years ago by codejp3. Reason: removed underlines because wordpress is not parsing them
    • This reply was modified 2 years ago by codejp3. Reason: added update message to the top
    codejp3

    (@codejp3)

    @fabienmahot777UDPATE!

    I took a closer look at your site and I noticed you have URL/permalink issues.

    Your site root URL is:

    https://avenirdebizanoscyclo.fr/

    But your forum is using this as the site root:

    https://avenirdebizanoscyclo.fr/index.php/

    The URL for the favorite/subscribe buttons is trying to load:

    /index.php/forums/topic/essai-de-transfert-lien-et-image/?action=bbp_favorite_add

    And the AJAX file is trying to be loaded from:

    /forums/topic/essai-de-transfert-lien-et-image/?bbp-ajax=true

    They don’t match. The “index.php” part is throwing it off.

    Also, in your main menu items for “forum” you have a link “Comité d’administration” that is showing the URL as:

    https://avenirdebizanoscyclo.fr/?post_type=forum&p=691

    It should be showing the permalink nice names, but it’s showing the raw URL query string without applying permalinks, and giving a 404 not found error (just like the favorite/subscribe AJAX file).

    You have some serious issues with permalinks.

    Double-check your permalink settings (wp-admin/options-permalink.php) & (wp-admin/options-general.php?page=bbpress) and make sure your .htaccess file is correct. Clicking “save” for both the bbpress permalinks and the main site permalinks pages should regenerate the .htaccess file.

    If you fix these permalink issues, it will probably work as expected.

    If the .htaccess file is not getting regenerated properly, you may need to contact your hosting provider/server admin to look into it.

    • This reply was modified 2 years ago by codejp3.
    fabienmahot777

    (@fabienmahot777)

    Thanks a lot @codejp3 ! You are a king !

    My problem is solve !

    I’ve modified the password of the user test to avoid problems -)

    codejp3

    (@codejp3)

    @fabienmahot777 – as your king, I demand tribute! 100 pieces of gold and your first born child. ??

    Just kidding. Glad it’s sorted.

    fabienmahot777

    (@fabienmahot777)

    ??????

Viewing 8 replies - 31 through 38 (of 38 total)
  • The topic ‘Subscribe to Forum Button not working’ is closed to new replies.