- This topic has 5 replies, 2 voices, and was last updated 2 months, 1 week ago by
Fernando.
-
AuthorPosts
-
May 31, 2022 at 11:12 pm #2239844
Ravi Saive
I am getting the following error in the nginx logs:
2022/06/01 06:10:45 [error] 215858#0: *462115 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $post in /data/httpd/htdocs/tecmint/wp-content/plugins/gp-premium/elements/class-hooks.php(215) : eval()'d code on line 1PHP message: PHP Warning: Attempt to read property "ID" on null in /data/httpd/htdocs/tecmint/wp-content/plugins/gp-premium/elements/class-hooks.php(215) : eval()'d code on line 1" while reading response header from upstream, client: 141.101.99.153, server: tecmint.com, request: "GET /install-lxqt-desktop-in-ubuntu-fedora/ HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "www.tecmint.com", referrer: "https://www.tecmint.com/lightweight-linux-desktop-environments/"
It seems the following Hook giving an error in the logs:
If you have any questions or doubts? do <a style="text-decoration:underline;color:bb0e30;" href="<?php echo get_comments_link( $post->ID ); ?>">ask for help in the comments</a> section.
May 31, 2022 at 11:19 pm #2239856Fernando Customer Support
Hi Ravi,
Can you try modifying the code to something like this?:
If you have any questions or doubts? do <a style="text-decoration:underline;color:bb0e30;" href="<?php global $post; echo get_comments_link( $post->ID ); ?>">ask for help in the comments</a> section.
Kindly let us know how it goes.
June 1, 2022 at 11:03 pm #2240949Ravi Saive
Hi @Fernando,
The code worked fine, but I am getting another error as shown:
2022/06/02 05:59:55 [error] 219688#0: *1065872 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key 0 in /data/httpd/htdocs/tecmint/wp-content/plugins/gp-premium/elements/class-hooks.php(215) : eval()'d code on line 6PHP message: PHP Warning: Attempt to read property "slug" on null in /data/httpd/htdocs/tecmint/wp-content/plugins/gp-premium/elements/class-hooks.php(215) : eval()'d code on line 11" while reading response header from upstream, client: 141.101.99.25, server: tecmint.com, request: "GET /how-to-hack-your-own-linux-system/5-2/ HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "www.tecmint.com
It seems the error coming from the following php code:
<div class="wpsp-related-posts grid-container"> <h2>Related Posts</h2> <?php if ( is_single() ) { $cats = get_the_category(); $cat = $cats[0]; } else { $cat = get_category( get_query_var( 'cat' ) ); } $cat_slug = $cat->slug; $list = get_page_by_title( 'related', 'OBJECT', 'wp_show_posts' ); wpsp_display( $list->ID, 'tax_term="' . $cat_slug . '"' ); ?> </div>
June 1, 2022 at 11:44 pm #2240973Fernando Customer Support
Where is this hook element displayed to?
Is it being displayed in a post with no category? Or are you setting this to display on non-post pages?
Kindly let us know.
June 2, 2022 at 11:24 pm #2242041Ravi Saive
I am displaying it on post pages which will show all related articles..
June 3, 2022 at 2:39 am #2242207Fernando Customer Support
To have a better understanding of the issue, may you kindly provide the link to the site in question?
You may use the private information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Hope to hear from you soon. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.