Tag Info

New answers tagged

-1

I realize this is an old thread, but it seems completely relevant to my issue, however the specifics are omitted from this thread. I would like to be able to dynamically fill the title field with content entered into custom fields. @orionrush you mention this functionality - would you be willing to post an example of the js that you use for this? I can not ...


3

The culprit here is sanitize_title() via the sanitize_title hook. The function hooked to it is sanitize_title_with_dashes(); I see @birgire tracked it down too, as it can be seen in wp-includes/default-filters.php. add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); You can use remove_filter() to do just that. ...


4

Regarding the why part, I think I've traced this to the following line: $title = preg_replace('|-+|', '-', $title); within the sanitize_title_with_dashes() function. It's added to the santize_title() via the filter: add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); but I wouldn't recommend removing it totally. Update: Here's a ...


2

It's not clear from your question if you actually want the word/number structure or you merely use numbers to distinguish endpoints as different. Natively in WordPress there is no concept of endpoint with variable name. You can use add_rewrite_endpoint() to create a endpoint endpoint, which will match requests like .../endpoint/123, .../endpoint/124, and so ...


2

It sounds like you need get_author_posts_url() which "Gets the URL of the author page for the author with a given ID." If you have set the custom permalink correctly it should work. If you really are looking for actual page IDs, there is no page ID for an author archive page. Those pages are dynamically generated and are not "posts", "pages", or any other ...


1

This can be a real pain, I know firsthand. The obvious place (that I sometimes forget) is your Trash folder. If it's not there, I would suggest re-saving permalinks. As a last resort, I'd do what you said... a bunch of searches of the database. One time a plugin had auto-generated a page, and after disabling and deleting the plugin, I found the bad URL in ...


0

Add a rewrite endpoint instead of a rewrite rule and query var. This API function will do both of these things for you. function wpd_add_my_endpoint(){ add_rewrite_endpoint( 'information', EP_PAGES ); } add_action( 'init', 'wpd_add_my_endpoint' ); Now any page can have information appended to the end, and the value will be available via ...


0

Try this, I did a quick test and it worked for me. I created a page called 'central'. Don't forget to flush the rewrite rules after inserting this code. add_filter('query_vars', 'query_vars'); function query_vars($vars){ array_push($vars, 'information'); return $vars; } add_action('rewrite_rules_array', 'rewrite_rules'); function rewrite_rules($rules){ ...


0

When we try searching for example.tld, then the default search query looks into the post title and content with: ... (wp_posts.post_title LIKE '%example.tld%') OR (wp_posts.post_content LIKE '%example.tld%') ... When we add an attachment or a local link, into the post content, we normally get the full url, for example: ...


0

Those are Apache .htaccess rewrite rules, but you have stated that you are on an Nginx server. Nginx does not use an .htaccess-like directory level file, much less does it use the .htaccess file itself.. You need to edit the server configuration itself. The Codex has a detail sample: # WordPress single blog rules. # Designed to be included in any server {} ...


0

I had this same problem when I cloned my site to set up a development server - for me, it working by setting permalinks to ugly, saving, then setting them to pretty again, which rebuilt whatever had gone wrong in htaccess.


0

According to the documentation here: http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress I assume you have already selected Post Name in your permalink structure: Then include this code in web.config <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" ...


0

Fixed this by changing permission on .htaccess to 444 from CPanel's file manager. For some reason my FTP client - even though logged in as the same CPanel user - could not make the change and the file would always revert back to 644. Cpanel had no such problem at all.


0

Normally WordPress does only affect rules between # BEGIN WordPress and # END WordPress, rules before or after this section should be left alone. Basic example from the codex htaccess entry: ### custom rules # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f ...


0

Hope You have imported it correctly. But I'll suggest you to try sql dump. Export sql dump from your database and import it in your local system. It will work correctly.


-1

Have you updated the links in your database? Are they still pointing to your live site? Sorry, I will elaborate. If you download your database you will see that the url for your live site will appear several times. For example: INSERT INTO `wpfr_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES (1, 'siteurl', ...


1

I know this is an old post, but I think there is wrong information here. I was having conflicts with slugs between different custom post types and taxonomies and decided to do some reading about it to understand it better. I am using WordPress 4.2.2, and I am able to create different posts types with the same slug. Apparently this is a known issue being ...


0

This should not be a problem unless you've a same slug page / post in your TRASH somewhere. Check your Pages / Posts trash and see if you've "series" slug there? If not, try creating another page and see if its just a matter of the page name / slug or its happening with all pages in 3rd level.


0

If you change the structure of the permalink, you have to provide the rewrite rules to understand the new structure. Also, you are not building the attachment permalink correctly. The next code is working: add_filter( 'attachment_link', 'wpd_attachment_link', 20, 2 ); function wpd_attachment_link( $link, $attachment_id ){ $attachment = get_post( ...


2

As you guessed and @Rarst suspected, there's a pagination check in wp_unique_post_slug() for hierarchical post types: preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) which will match any numeric only slug, optionally preceded by "page". To get around this you could use the 'wp_unique_post_slug' filter, basically replicating the original ...


0

I would suggest you to use WP_Query for this purpose. An example of this query is here in this plugin which fetches only relevant posts instead of using further PHP functions. You can choose a faster way to go on, Alphabetic Pagination Plugin


0

Setting with_front to false solved the issue.


0

Most likely you at some point uploaded something called "about us". (You can see it if you go to site/about-us) In this case you apparently have to delete and re-upload the file, after setting page permalink to what you want. See https://core.trac.wordpress.org/ticket/32048, and https://core.trac.wordpress.org/ticket/24612


1

It would be more correct to say that CPTs can be hierarchical and non–hierarchical. Page and post are just respective examples of such, and by the way as native post types they aren't quite the same thing as CPTs. Clearly, when you have multiple CPTs in a site it's important that not a single combination of slugs leads to ambiguous permalink, that might ...


1

After some brainstorming and a lot of trial and error with T5 Rewrite and HM Rewrite, I went for the simplest possible solution. The permalink was actually intercepted by WordPress so I didn't need the additional rewrite rule (even though it didn't hurt, other than performance). I left %category%/%post_id%/%postname% as the default custom permalink, and it ...


1

I ended going the CPT route, as I couldn't figure out other way. Just added a bunch of logic to duplicate/modify/delete the normal posts when needed. <?php // function for the CPT function SU_kuuma_kysymys_type() { // creating (registering) the custom type register_post_type( 'kuuma_kysymys', /* ...


0

Redirect- If you did a proper redirect, there is no content on the pages you're redirecting from. So there's no issue with the content being duplicate. Tags/Categories- If the categories and tags serve a function and add value, then they're not really duplicate content. So choose categories and tags wisely. I wouldn't delete old ones because there might be ...


0

noone likes to change urls - it's an extra headache. However, google tries to be liberal, so it tries best, to accomodify your changes and not to loose your SEO, and if you redirect 301, then everything should be ok, however i think so. Of course, you should make redirection, because duplicate content is very very bad.



Top 50 recent answers are included