New answers tagged

0

Hashes are used in web addresses to navigate to anchors on a specific position within a page. The part after the # symbol is never sent to the server. That's probably why WordPress doesn't allow hashes in URLs. If it did, you wouldn't be able to access the page anyway.


0

You can try a plugin like wp-optimize, but if the page is still stuck, it sounds like your database is in a strange state for that page. You'll need to find out the name of your WordPress database by logging in to your site host and then opening up phpmyAdmin. Click on the '+' next to the database name to expand the tables. If you only have one instance of ...


1

There is a function that is looking for duplicated post names: wp_unique_post_slug. In this function are few queries, and one of them is looking for duplicated post names: SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1. If this query will return some rows then function will add suffix to post name. So you ...


1

Modifications of the core code are not recommended. Note that the core get_comments_link() function considers two cases of $hash: $hash = get_comments_number( $post_id ) ? '#comments' : '#respond'; Also note the second input argument is $post_id. Here's your modified example: add_filter( 'get_comments_link', function( $link, $post_id ) { $hash = ...


0

While I agree with @cybmeta that it sounds like an edge case considering WP, it's a reasonable requirement. And we throw out questions that are too general :-) I'm sidestepping your exact question a little, as I can see that creating a number of posts and forcing their slugs to be non-unique might be a recipe for future disaster. What do you do to the ...


0

Based on the info in the comments, here's my preliminary answer, hopefully helping to debug the issue rather than a fix as I can't see enough info for that — not the OP's fault, rewrite debugging is just a pain. The rewrite rule is obviously passing something to WP but WP isn't happy with it. What I'd do is add some debugging code to your theme's 404.php ...


0

I once had a problem like this. On my site was a malware and it edited a .htaccess file. Check by FTP that your .htaccess file is not changed. If yes, scan your site by any online malware scanner or any security Wordpress plugin.


1

Yes! Go to your Media Library Find the Image Click Edit Locate the Permalink under the Title Click Edit Change the Permalink Click Update! Edit If for some reason you cannot Edit the Images' Permalink... you could: Delete Image Change your Pages' Permalink Re-Upload Image


3

I know this topic is old, but I was having the same issue, and none of the suggested fixes worked. I didn't have any pages still in trash. I didn't have a category with the same name as my page. I didn't have another page with the same name. So I did something crazy. WP was trying to name my page as page-2, so I went to mywebsite.com/page to see what ...


0

In general page URL are "last resort" match when nothing else fully matches the URL. This means that you can have something like example.com/category/cat1 be a URL of a category and example.com/category/cat1/page1 be a URL of a page. For the last to work you obviously need a grandpa page with slug "category" and a father page with slug "cat1". It is not ...


0

I would think something is wrong here: $meta = get_post_meta( $post->ID, $extlink , TRUE ); This is the function: get_post_meta( int $post_id, string $key = '', bool $single = false ) You are setting the $extlink as the $key parameter, but it is really a meta key? From your explanation, it seems to be a value of the bookzone key ... If the above ...


0

(EDIT) Take the custom rules outside the # Begin Wordpress (credit to Tim Malone) You can check if the file exists in the root and load it before the Wordpress rules kick in: # check for a file, i.e register.php # load it if found and stop processing the rest of the rules with the [L] flag <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{...


-2

Go to your WP-ADMIN-->Settings-->Permalink and Select Plain Redo Option and Save. Problem will be solved.


1

Try creating a custom rewrite rule and a custom rewrite tag. This should allow you to set up a regular expression to capture the ID and manipulate the query. Rewrite API/add rewrite rule « WordPress Codex https://goo.gl/kdEJd8 Rewrite API/add rewrite tag « WordPress Codex https://goo.gl/PVLzLh


0

Turn off any caching plugins you are using and reload the page after clearing browser cache. Once fixed turn caching plugin back on and you should be fine. This worked for me a while back when i had this issue


-2

<?php //simple wordpress loop $loop= new WP_Query( array( 'post_type'=>'post', 'orderby'=>'ID', ) ); if($loop->have_posts()): while($loop->have_posts()): $loop->the_post(); ?> //all the stuffs you want to put in <a href="<?php the_permalink(); ?>"><h2>...


-2

Use get_posts with posts_per_page => 1 to get only one latest result. You can than use get_permalink() to get the permalink. $args = array( 'posts_per_page' => 1, 'orderby' => 'date', 'order' => 'DESC', ) ; $latest_posts = get_posts($args); $permalink = get_permalink($latest_posts[0]->ID);


1

Duplicates don't just come from Pages and Posts, WordPress also defines Images and Files from the Media Library as "Posts". This means if you have a file / image in the Media Library with the same name as a page, it will assign the next duplicate a -2 ( from the wp_unique_post_slug() function ) so there's no URL conflicts. TL;DR - Duplicate? Search for ...



Top 50 recent answers are included