Forum Replies Created

Viewing 15 replies - 1 through 15 (of 37 total)
  • Thread Starter metalhead

    (@aaronthomas1979)

    I can’t remember if I tried 4.7.7, but this problem has definitely been solved as of 4.8.8

    Thanks very much for that!

    Thread Starter metalhead

    (@aaronthomas1979)

    Update:

    I reverted back to version 4.7.4 and it’s working again.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thanks, you were right.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thanks for this advice.

    One (hopefully) small setback to this is that this message page isn’t actually a page. Will that be a problem? It has a url, like this: /site/username/messages

    Is there a way to refer to the url instead of the page ID?

    I apologize for being so illiterate about all this, and I appreciate your patience.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thank you to both of you for the replies. Yes, I’m trying to get the menu item called “Mail” to remain highlighted while active.

    I read about get_queried_object_id() on a few forums, but I couldn’t understand how it works. Here’s an example of what I found:

    function get_queried_object_id() {
      global $wp_query;
      return $wp_query->get_queried_object_id();
    }

    My assumption is that this is a core function, and I can run it, but how will I use it in this case?

    I’m guessing that the code I’m lacking would work something like this:

    (First, I’d set up a class for “Mail” and call it MailClass, then I’d do this:)

    if ($wp_query->get_queried_object_is() !== current)
    <script>
    $(".MailClass").attr('class', 'current');
    </script>

    Am I way off? I’ll try this in the meantime, but my chances of being right about this are slim. ??

    Thread Starter metalhead

    (@aaronthomas1979)

    Sorry, please disregard this message. It’s not your plugin, because it happens on other pages too. I guess it’s my theme.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thanks for your guidance. I was pushing my brain to the limit for a while there, but then I stumbled upon an article that made things easier. (Google destroys brain cells!)

    But in case anyone else wants to accomplish putting comments on the last paginated page of your articles, here’s what I found:

    1) Disable commenting

    2) Add this function to your child theme’s functions.php:

    /**
     * Display the comment form via shortcode on singular pages
     * Remove the default comment form.
     * Hide the unwanted "Comments are closed" message with CSS.
     *
     * @see https://wordpress.stackexchange.com/a/177289/26350
     */
    
    add_shortcode( 'wpse_comment_form', function( $atts = array(), $content = '' )
    {
        if( is_singular() && post_type_supports( get_post_type(), 'comments' ) )
        {
            ob_start();
            comment_form();
            print(  '<style>.no-comments { display: none; }</style>' );
            add_filter( 'comments_open', '__return_false' );
            return ob_get_clean();
        }
        return '';
    }, 10, 2 );

    3) Use this shortcode on the last paginated page of your post: [wpse_comment_form]

    Voila! People can then only comment if they are on the last paginated page of your post. I love it. I hope this works forever. But if not, then refer back to the advice bcworkz was helping me with. It’s always better to do things from scratch, and he gave us the foundation details we need to go that route.

    (Case Closed, for now!)

    Thread Starter metalhead

    (@aaronthomas1979)

    Thank you. The fix noted in that article seems to have solved the problem.

    Thread Starter metalhead

    (@aaronthomas1979)

    Update: I should have mentioned this, but it’s too late for editing:

    “Log In” is the title of my homepage. But why is it showing up at the tail of my SEO titles in Google’s search results?

    Thanks for any help with this.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thanks very much!

    In this case, I was using the Yoast SEO plugin, and I found the option you mentioned. Making that change seems to have instantly corrected the issue. Thanks again!

    metalhead

    (@aaronthomas1979)

    Thanks for this info!

    However, it seems as though there are php files within wordpress that do not automatically convert links to https when WP admins specify their site in the settings as “https.”

    Can that be resolved in a future version?

    Thanks for all you guys do, and sorry if I’m missing something here.

    Thread Starter metalhead

    (@aaronthomas1979)

    Thanks for your reply. I’m quite the rookie with PHP, so please bear with me.

    wp_link_pages() is located in wp-includes/post-template.php, so I think that means that I’m unable to copy post-template.php over to my child-theme, therefore, I’m reluctant to make any changes to the file.

    What would be a safe way to modify or over-ride that function, without potentially causing problems? Is writing a plugin my best solution? (I’ve never done that before, but it’s never too late to learn, I suppose!)

    Thread Starter metalhead

    (@aaronthomas1979)

    Yes, here is a link to my registration page.

    I reverted back to the previous version of Buddypress, for now, so I’m not sure if my site will be helpful to you or not, in this case. (I’m not sure which way you need to see the site – functioning with the old BP, or malfunctioning with the new BP?)

    If it will be helpful for you to see it malfunctioning with the new BP, let me know, and I will update it and get back to you.

    • This reply was modified 8 years, 3 months ago by metalhead.
    Thread Starter metalhead

    (@aaronthomas1979)

    I think you are absolutely right about the javascript error.

    I’m using a special function with the Date of Birth field, where it asks for month first, instead of day first. (Because it’s how we typically request it in USA.) I deleted the date of birth field, and the new registration saves just fine.

    This is the function: (You gave it to me a few months ago)

    /**
     * Changes the birthdate field type display: month - day - year.
     * Uses:
     *  - 'bp_after_profile_edit_content' hook for edit profile form.
     *  - 'bp_after_register_page' hook for registration form.
     */
    add_action( 'bp_after_profile_edit_content', 'change_birthdate_display_js' );
    add_action( 'bp_after_register_page', 'change_birthdate_display_js' );
    function change_birthdate_display_js() {
        ?>
        <script>
            jQuery(function($) {
                if ($('.bxcft-birthdate-month').length > 0) {
                    $('.bxcft-birthdate-month').each(function() {
                        $(this).insertAfter($(this).parent().find('label'));
                    });
                }
            });
        </script>
        <?php
    }

    Do you know of an easy solution by any chance? If not, I can just ask users for their age instead of DOB.

    Thanks!

    metalhead

    (@aaronthomas1979)

    I think you’re talking about the members-loop.php, right? Your “Member List?”

    To display actual age instead of date of birth in members-loop, use this:

    echo xprofile_get_field_data('Date of Birth', bp_get_member_user_id());

    Date of Birth is the name of my field, so just replace that with yours.

    • This reply was modified 8 years, 3 months ago by metalhead.
Viewing 15 replies - 1 through 15 (of 37 total)