I have encountered a very weird issue after the last update to WP 4.4.1 and it's that the href attribute on all blog posts in the website.com/blog section are missing, so the link looks like this:
Most read articles in the previous year
The articles are normally accessible and have the href attribute from the front page of the blog, where they point to: website.com/texts/name_of_the_blogpost just not from website.com/blog
Did anyone else ever experience such an issue, and could the update of WP be the reason for it? Everything worked normally until the update.
Your theme may use a now deprecated (under 4.4.1) WordPress function. Switch to the default WordPress twentyfifteen or twentysixteen theme for a minute and see if the php function correctly outputs the URLs of the blog posts. If so, it's your theme. Talk to the theme developer or take a look at the functions in theme files, the query loop, etc. No one can help more until you post some code.
Related
I have looked all over the place and can't figure out how to get this to work.
I want my urls for blog posts to look like this: "www.website.com/my-page/category-name/blog-post-title"
The issue I am having is that I have a page called "my-page".
So I have a page "www.website.com/my-page/" which is just a standard wordpress page, but I want the url for the blog post to look like it is under that page.
Here is what I have for the permalink so far:
/my-page/%category%/%postname%/
But this doesn't work and gets a 404 error when opening a blog post.
At this point I don't believe it can be fixed through the wordpress gui, so if anyone has any recommendations, it would be appreciated.
Thanks!
Edit: I wanted to add that the permalink works fine if I remove "/my-page" or if I simply modify it so it does not match the page.
First of all you should not use the category in front of your permalinks as it leads to bad performance (and some posts may have multiple categories): http://ottopress.com/2010/category-in-permalinks-considered-harmful/
The second thing is - it should work. I tried with a fresh installation on WordPress and I get the correct results.
Did you flush rewrite rules / save the new permalink structure?
Did you publish a post?
Is your server correctly configured to use permalinks?
Third possibility - if your permalink structure does not work for some reason you can define a custom permalink structure:
https://codex.wordpress.org/Rewrite_API
I'm wondering how I can change the "← Previous Entries" to like a page count, for example 1,2,3,4,5 and so on.
How can I do this with only PHP code, I can't really find anything on Google off course. Maybe I always search for the wrong name, but I've tried for like 30 minutes and this is my last shot!
You can see my Wordpress page here, this is a self designed website. http://codingdaily.net/freebies
I think what you're referring to is called pagination.
Wordpress Codex Reference
WPtuts Tutorial on pagination
Hope this helps.
It depends from theme to theme.
You can customize using the next_posts_link and the previous_posts_link functions.
In the major of themes, you can check inside wp-content folder, themes, look for your theme then look for a file called loop.php.
Make a search for those functions above and you will see how it works.
Im running Wordpress 3.1 and its showing that there are comments (ie: 3 comments) but when you click into the single blog post they don't appear but the comment form appears.
Im not sure whether its a template issue or something's not correct in the functions.php.
I have the multi site function running for multiple blogs.
Anyone else having this problem and or have a solution?
It has to be template issue, make sure that you have comments.php file present in your theme directory. You may want to copy from default theme too. The functions.php has nothing to do with that though.
I have created a wordpress.org blog on my website but I do not use the actual blog page to display the blog posts. Initially I tried to style the wordpress blog to match my site, but since wordpress' theme is too constricted I decided to use "the loop" to gather the_author_posts_link, the_title, the_content, etc and display them on my main page. (reference: http://www.corvidworks.com/articles/wordpress-content-on-other-pages). The problem I am running into is the comment section. No matter what, I cannot seem to find a way to add comments to my front page using php. I know I can get my post content to display by calling the_content(), but I cannot seem to find a similar function for comments. I'm open to any solution that will allow my pseudo-blog to display comments under each post.
Thank you!
Should be <?php comments_template(); ?>. Look in your theme files for that template tag. But it working depends on if you've correctly included the blog header on your non-WP pages.
Currently there is a bug in WordPress if you have a Posts Page set under:
Settings->Reading->A Static Page->Posts Page
If there are posts, than the page (e.g. with a slug called news) displays the post, and uses index.php from the theme.
But, with this configuration, if there are no posts, then it calls the theme's 404 page. This is definitely a bug, and has been submitted (Ticket #10822). It should be letting index.php show whatever it wants upon !have_posts(), but right now the page doesn't seem to be called at all.
My question is: is there a workaround for this bug without modifying core wp files? I'd be open to a plugin, theme changes, a custom page template, htaccess changes, etc.
I just performed a test for it. It isn't actually serving a 404, it's using index.php but since no posts are found so it falls outside of the have_posts(). Are you sure it's not a plugin or theme causing your issue? I tested this with the default theme on a base install of WordPress.
Most theme files have as part of their WP loop a catch for no posts, i.e.:
<?php else : ?>
Sorry, but you are looking for something that isn't here.
<?php endif; ?>
That might be what you're seeing. You can use a custom page template without that text (leave the loop) for yoiur posts page. And try Reveal Template | coffee2code.com to find out what template file you're looking at.