I deactivated the plugins as you suggested through FTP. I got right in and then started to reactivate 1 by 1 the plug-ins and found the little bugger that was causing the issue.
Quiz And Survey Master, Version 6.4 By ExpressTech
I have been able to reactivate everything else and all is fine! I have logged in and out several times, different browsers and even once just to make sure installed it again, and had to deactivate all plugins again.
As in Support Post: https://www.ads-software.com/support/topic/cant-login-to-dashboard-admin/#post-12285210
This was the original issue:
Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/post.php on line 4323
Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/link-template.php on line 49
Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/link-template.php on line 49
Fatal error: Uncaught Error: Call to a member function get_author_permastruct() on null in /home/mymembe1/quiz/wp-includes/author-template.php:346 Stack trace: #0 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/SharedPageUrls.php(184): get_author_posts_url(‘1’) #1 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/PgCacheFlush.php(119): W3_SharedPageUrls->get_post_author_urls(‘1’, 0) #2 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/CacheFlushLocal.php(103): W3_PgCacheFlush->flush_post(49) #3 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/CacheFlush.php(106): W3_CacheFlushLocal->pgcache_flush_post(49) #4 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/Plugin/PgCache.php(259): W3_CacheFlush->pgcache_flush_post(49) #5 /home/mymembe1/quiz/wp-includes/class-wp-hook.php(288): W3_Plugin_PgCache->on_post_change(49, Object(WP_Post)) #6 /home/mymembe1/quiz/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #7 /home/mymembe1/quiz/wp- in /home/mymembe1/quiz/wp-includes/author-template.php on line 346
I have moved on to a different plug-in that has not crashed my site.
]]>Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/post.php on line 4323
Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/link-template.php on line 49
Notice: Trying to get property of non-object in /home/mymembe1/quiz/wp-includes/link-template.php on line 49
Fatal error: Uncaught Error: Call to a member function get_author_permastruct() on null in /home/mymembe1/quiz/wp-includes/author-template.php:346 Stack trace: #0 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/SharedPageUrls.php(184): get_author_posts_url('1') #1 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/PgCacheFlush.php(119): W3_SharedPageUrls->get_post_author_urls('1', 0) #2 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/CacheFlushLocal.php(103): W3_PgCacheFlush->flush_post(49) #3 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/CacheFlush.php(106): W3_CacheFlushLocal->pgcache_flush_post(49) #4 /home/mymembe1/quiz/wp-content/plugins/a2-w3-total-cache/lib/W3/Plugin/PgCache.php(259): W3_CacheFlush->pgcache_flush_post(49) #5 /home/mymembe1/quiz/wp-includes/class-wp-hook.php(288): W3_Plugin_PgCache->on_post_change(49, Object(WP_Post)) #6 /home/mymembe1/quiz/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #7 /home/mymembe1/quiz/wp- in /home/mymembe1/quiz/wp-includes/author-template.php on line 346
Thanks for any help!
]]>I am trying to use WP-PageNavi with the Gazette theme (https://www.ads-software.com/themes/gazette/).
In Gazette, the calls to next_posts_link()
and previous_posts_link()
are located in the file \inc\template-tags.php
(under function the_posts_navigation()
). In this file, the_posts_navigation()
is a “pluggable” function (it is enclosed by if ( ! function_exists( 'the_posts_navigation' ) ) :
)
So I tried to simply copy the function the_posts_navigation()
to my child theme and replace the necessary lines in order to use WP-PageNavi. “Since the_posts_navigation()
is a pluggable function,” I thought, “I won’t have to do anything else”.
Unfortunately, I was wrong. It’s not working.
I use the plugin Code Snippets (https://www.ads-software.com/plugins/code-snippets/) to manage my custom snippets, and when I try to activate the snippet below…
function the_posts_navigation() {
// Don't print empty markup if there's only one page.
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
?>
<nav class="navigation posts-navigation" role="navigation">
<h2 class="screen-reader-text"><?php _e( 'Posts navigation', 'gazette' ); ?></h2>
<div class="nav-links">
<?php if ( get_next_posts_link() ) : ?>
<?php wp_pagenavi(); ?>
<?php endif; ?>
<?php if ( get_previous_posts_link() ) : ?>
<?php wp_pagenavi(); ?>
<?php endif; ?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
<?php
}
I get this error:
The code snippet you are trying to save produced a fatal error on line 22:
Cannot redeclare the_posts_navigation() (previously declared in /[redacted]/public_html/wp-includes/link-template.php:2462)
Interestingly, the problem is related to the file public_html/wp-includes/link-template.php
, not a theme file.
What should I do to use WP-PageNavi in my theme?
Thanks in advance.
https://www.ads-software.com/plugins/wp-pagenavi/
]]>Notice: Trying to get property of non-object in /public_html/dev/wordpress/wp-includes/link-template.php on line 337
From my searching I found that a similar error message occurs when a site is hacked and the link-template.php file name is changed.
The sections of code correspond to the following code:
/**
* Retrieve the permalink for current page or page ID.
*
* Respects page_on_front. Use this one.
*
* @since 1.5.0
*
* @param int|object $post Optional. Post ID or object.
* @param bool $leavename Optional, defaults to false. Whether to keep page name.
* @param bool $sample Optional, defaults to false. Is it a sample permalink.
* @return string The page permalink.
*/
function get_page_link( $post = false, $leavename = false, $sample = false ) {
global $wp;
$post = get_post( $post );
if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) )
$link = home_url('/');
else
$link = _get_page_link( $post, $leavename, $sample );
/**
* Filter the permalink for a page.
*
* @since 1.5.0
*
* @param string $link The page's permalink.
* @param int $post_id The ID of the page.
* @param bool $sample Is it a sample permalink.
*/
return apply_filters( 'page_link', $link, $post->ID, $sample );
}
Any help would be appreciated.
]]>“Warning: trim() expects parameter 1 to be string, array given in /home/onehopenetvps/onehope.net/wp-includes/link-template.php on line 3156”
The weird thing is that when I go to any page, post, or custom category (we have several) to look at an individual post, I see the same error where the featured image used to be.
“Warning: trim() expects parameter 1 to be string, array given in /home/onehopenetvps/onehope.net/wp-includes/link-template.php on line 3156”
Even stranger, when I click on “Set Featured Image,” I get the media chooser with the correct image selected. Which means that WordPress is writing the file to the database correctly. It’s just being read incorrectly. Both on the front end and on the back end.
Anyone else seeing this? Any ideas what might be going wrong?
Thanks for your help!
Jeremy
https://www.ads-software.com/plugins/advanced-custom-fields/
]]>“Warning: trim() expects parameter 1 to be string, array given in /home/onehopenetvps/onehope.net/wp-includes/link-template.php on line 3156”
The weird thing is that when I go to any page, post, or custom category (we have several) to look at an individual post, I see the same error where the featured image used to be.
“Warning: trim() expects parameter 1 to be string, array given in /home/onehopenetvps/onehope.net/wp-includes/link-template.php on line 3156”
Even stranger, when I click on “Set Featured Image,” I get the media chooser with the correct image selected. Which means that WordPress is writing the file to the database correctly. It’s just being read incorrectly. Both on the front end and on the back end.
Anyone else seeing this? Any ideas what might be going wrong?
Thanks for your help!
Jeremy
]]>My site died two times and it showed two lines of code related to “link-template.php”. So I went to the cpanel -> wp-includes and saw that the file “link-template.php” had been renamed to “link-template.php.suspected”. I just want to know how this renaming happened. Is it because of a specific plugin?
But yes, the site become live after renaming “link-template.php.suspected” to “link-template.php”.
Thanks
]]>First off, thanks for taking the time to read this and I hope you can help.
I am working on a website that has many portfolios which are spread within 4 different portfolio types. On each page for a single portfolio, the website’s theme, Galao supported by themejug, calls the next_post_link and previous_post_link function from the wp-includes/link-template.php file. When I click the link to move to the next or previous portfolio I will eventually get to a portfolio of another portfolio type. With all that said, I am wondering how I would go about modifying the next_post_link and previous_post_link functions or any other functions they call so that the next or previous portfolios must be within the same portfolio type?
Once again thanks for your time,
Garrett
]]>https://www.ads-software.com/support/topic/plugin-theme-my-login-fatal-error-link-templatephp-on-line-274
Seems to be an issue with the plugin. You can disable the Theme My Login plugin from within the WordPress dashboard or through renaming the individual plugin folder within /wp-content/plugins/ to theme-my-plugins.disabled for testing. Please let us know if we can assist you in any other way.” Nothing further… in 3 days even after I contacted them back.
Help me out, I assumed that if I deleted the login plugin that it would revert to a default wordpress login? Had I known that I should have replace that plugin with a newer updated plugin, clearly I would have done it right then… But I’m past that now…
How do I fix it? Please… Make my day
]]>