Every post permalink takes me to last published post.
For example both
http://randomwebsite.com/?p=554 and
http://randomwebsite.com/?p=556
Take me to same article, and it is always the newest post.
I tried changing permalink structure, and reinstalling WordPress, but still no go.
It is very strange problem and I never had it before.
Any ideas why this could be happening?
As Joren mentioned in the comments, this sounds like it could be a template problem. That is, your post data may be loaded as it should, and your permalink structure may be fine, but if the posts are being routed to a template file which is hard-coded to display only a single (most recent post) then you will have this problem.
You can confirm this is in fact the problem by switching to another, more standard theme, (like twentytwelve,twentythirteen...) and verify that the issue is resolved.
If that indeed does fix the problem. Try to determine which template file is being loaded in your theme by digging around in the source (the files are found here: wp-content/your-theme/template-file.php) or by reading this page of the WP documentation: https://codex.wordpress.org/Template_Hierarchy. Then debug the code as necessary.
Related
So i have Wp rocket on my site and i saw that every time i modify a image or a text from my site, the homepage appears white with only the cookie icon visible.... i have to delete cache each time this happens and also i have to check page every time.. This i what support said but no clue.....
I enabled WP Debug while performing the following test:
I made a small edit (added a dot at the beginning of the content) and saved the settings. I visited the page from desktop and from mobile, but it rendered correctly. I repeated the test by reverting the change I made. Still, the page got rendered correctly.
So far I could not reproduce the issue, but I checked the information provided by Sandy. Based on my observations, the issue is not related to WP Rocket, but I will explain to you why you see it when WP Rocket is enabled.
Generally, when a page is rendered in WordPress your theme is rendering the following parts of the code in the exact order for each page:
header.php
template (i.e. the content)
footer.php
When the issue occurs, the template part is missing. Here is how I found it:
Sandy was able to reproduce the issue in the past and shared the code difference between the blank page and the correctly displayed page. You can find it here: https://www.diffchecker.com/AKBv9sVj/
Here is the place where part of the HTML is missing on the "blank" page. And I highlighted the last line of code that is included in both cache files:
Full-screen image: https://i.imgur.com/28DgxpT.png
That last line of code comes from header-adora-framework.php which is included with no issues:
Similarly, the next segment that both pages have in common comes from the footer:
Full-screen image: https://i.imgur.com/wsw4wHk.png
This is where the code in footer-adora-framework.php, and it is also included with no issues:
Full-screen image: https://i.imgur.com/9Nw0QDv.png
Based on this, I can see that the template part is missing. It seems your theme is not rendering the template sometimes.
I checked the debug.log that is available on the server and found the following fatal error that might be related to the issue:
Here is the main part of the error: "The template "/wp-content/themes/project-theme/templates/layout.html.php" cannot be rendered."
If you check the file mentioned in the error, you will find that this is exactly the part that is missing:
Full-screen image: https://i.imgur.com/SpLKbyH.png
The code from /wp-content/themes/project-theme/templates/layout.html.php:
Full-screen image: https://i.imgur.com/7KfMxCR.png
The reason that you see the issue only when WP Rocket is enabled is due to caching. WP Rocket "takes a snapshot" of the page the way it was rendered the first time it was accessed.
If the template did not render the template part when the page was accessed - this is how the page will be cached and you will see the issue persists.
This, however, does not mean that the issue is resolved when you disable WP Rocket.
The issue is happening, but it is not persistent as with caching. Refreshing the page when caching is not present would likely resolve the problem.
You would need to pass this information on to your theme support. Possibly they will have suggestions on how the problem can be resolved.
I try all but nonthing. I hope to fix this with your help
enter image description here
Hello,
I'm trying to solve this problem in Wordpress. I need to have my permalink structures as post names, so making them plain is not an option even if it fixes this problem (it generates others).
As I've seen:
I need to put into the file manager, because I can't access and edit my page using elementor.
Now I have tried to change the php for different reasons the last days, like colors etc., but always, like now, I can save my changes but nothing changes at all.. Am I doing something wrong?
Thanks a lot!
Marc White
according to me there is something wrong with your data. As some github like pass custom php function to solve this error.
Github link for the related issue- Link
If you still face issue just lemme. I think will help you.
I'm trying to setup a permalink structure like so 'example.com/post/post_id/any-text-here'. Which is kinda similar to how SO's permalinks to questions work. If the last part is changed it still loads the right page as long as the first part contains the correct question ID. I'm not sure if it's redirecting or pushing the question title back into the URL when you do that though.
I've tried /post/%post_id%/%postname%/, but that requires the correct post title in the url. I want that portion to not matter, but still have the flexibility in being able to place a title in it.
I'm guessing some server configuration changes may be required. I'm running NGINX.
Your proposed structure of /post/%post_id%/%postname%/ appears to work perfectly for me. http://domain.com/post/1/anything/ correctly redirects to http://domain.com/post/1/hello-world/, where hello world is the post title.
If this definitely is not happening for you, try disabling all plugins temporarily - something could be re-interpreting the url structure.
It seems like others have experienced similar issues as me in the past on this subject, but nobody has provided a complete answer.
I'm attempting to run a PHP script to update the permalink structure in the wp_options table for a slew of Wordpress blogs. I want to connect to each database and update the permalinks without having to log in to each blog and update the setting through the UI.
I'm successful at connecting to the DB and updating the permalink_structure field with the proper codes, but it causes a 404 when attempting to view any posts.
Is Wordpress updating other tables/fields to fully enable the permalink?? I'm having a hard time finding the complete answer to this.
BTW: If there are edits being made to the .htaccess when this is done through the Wordpress UI, I'm not seeing it. The htaccess looks unchanged when I do this through the UI.
Thanks!
Wordpress permalink rewrite_rules are kinda troublesome. They are great if you wanna do basic stuff, but it's damn hard to do some complex rules with it.
What exact structure you wanna use?
Remember that htaccess created by Wordpress just redirects everything to index.php, which loads Wordpress system (wp_load()), and one of its components parses REQUEST_URI.
First it tries to to bind REQUEST_URI into one of its regexes, which makes it understand what kind of resource is being requested (category, tag, page, post, etc), then it tries to find which resource it is (if it's a post, find which post by it's slug).
I installed a new wordpress blog today (v3.4.2, Windows 2008 R2, IIS7.5, SQL Server 2008 R2). I have already done this several times, and I have never had this happen before.
When I create a new post and publish it, everything looks fine. When I go to view it through the link in the edit post page, everything looks good. Then I open the blog homepage and I don't see the post in the latest posts. When I go back in to wp-admin I see that there is (1) post in "all posts", but the list is empty.
I tried creating a second post, and when I view it from the editing page, I can see it and the one I "lost" before. I tried to see maybe there was a difference in the URLs, but they are the same.
Anyone seen this before? It is driving me insane.
I tried turning off all plugins and also switching to another theme, and nothing.
I found the solution. Apparently, due to some regex issue in the abstraction plugin, mysql's limit was not being translated to sql server's top.
Found the solutions here:
https://wordpress.stackexchange.com/questions/51134/dashboard-says-no-posts-found-even-though-there-are-some-posts
Give credit where credit is due :)