[Resolved] I have a few questions about GP functionality.

Home Forums Support I have a few questions about GP functionality.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1218377
    Lee

    Hi. I have a few questions about GP functionality.

    1.
    I would like to add a link to the content of the post in the “Preview article (summary)” of the blog. (Even if I click “Preview post (summary)”, I want to move to the post just like clicking on the title, image, “Read more”, and date.)
    I am wondering if there is any relevant PHP code.

    2.
    This is a question about a blog comment.
    How can I change the text of “Leave a comment” and “Comments”?

    3.
    This is a question about a blog comment.
    “Leave a comment” is not visible when there is no comment, but I am wondering if it is possible to make a comment appear like “1 Comments” when there is a comment

    #1218946
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    1. I’m not too sure what you mean here. Are you wanting to allow links in the post excerpts?

    2. Are we talking about these words in the post meta, or above/inside the comments area on each single post?

    3. In the post meta? “Leave a comment” should appear if there are no comments, then “x Comments” should appear when a comment exists. I’m seeing this on your blog right now – the post at the bottom left says “3 Comments”, while the others say “Leave a comment”.

    Let me know 🙂

    #1218957
    Lee

    Thank you for answer.

    1. Yes, it is. I want to go to the post by clicking on “post excerpts”.

    2. Yes, it is. I want to change the text shown in archives and single posts.

    3. In short, I would like to make the “Leave a comment” area invisible when there are no comments on the post.

    #1219810
    Tom
    Lead Developer
    Lead Developer

    1. Do you have examples of this I can check out? I’m not sure I fully understand what’s needed.

    2. Try this:

    add_filter( 'gettext', function( $text, $original, $domain ) {
        if ( 'Leave a comment' === $text && 'generatepress' === $domain ) {
            $text = 'Your new text';
        }
    
        if ( '1 Comment' === $text && 'generatepress' === $domain ) {
            $text = 'Your new text';
        }
    
        if ( '% Comments' === $text && 'generatepress' === $domain ) {
            $text = 'Your new text'; // Use % in place of the number of comments.
        }
    }, 10, 3 );

    3. Try this:

    add_filter( 'generate_show_comments', function( $show ) {
        if ( ! get_comments_number() ) {
            return false;
        }
    
        return $show;
    } );

    Let me know 🙂

    #1220184
    Lee

    Thank you for answer.

    Case 1
    In “Blog Archive”, the class name is “wp-show-posts-entry-summary”. I wish I could see the content of the post by clicking on this part.

    Currently, there are multiple links to a single item in the “Blog Archive”, such as title, image, date and comment. It’s best to combine this link into one, but it seems like it’s not possible, so I’d like to link to the “Written example”.

    So I can’t find a deserved example. Normally, there is only one tag that wraps an entire item.

    Case 2
    When applied to “snippets,” it seems to affect the text on the WordPress admin page. So it seems difficult to apply.

    Case 3
    It works just fine!

    #1221042
    Tom
    Lead Developer
    Lead Developer

    1. This is pretty difficult unless you do something like this:

    .wp-show-posts-entry-title a:before {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        content: " ";
    }
    
    .wp-show-posts-inner {
        position: relative;
    }

    2. I adjusted the code above – can you give it another shot?

    #1221645
    Lee

    thank you for the reply.

    The problem with the first question has been fixed. Everything works fine in “Blog Archive” as well as “WP Show Posts”.

    However, in the case of the second question, even if the above code is applied, some characters on the WordPress admin page and the page created with “WP Show Posts” will still disappear. If you see the code presented by the administrator not working, it seems that there is a problem with my site. So, I decided to subtract the part related to comments from the page produced by “WP Show Posts”.

    Thank you very much for helping with the above question.

    #1222429
    Tom
    Lead Developer
    Lead Developer

    Is everything working as it should now, or are you still needing to adjust something?

    Let me know 🙂

    #1222856
    Lee

    No problem now!
    Thank you.

    #1223752
    Tom
    Lead Developer
    Lead Developer
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.