Tag Info

New answers tagged

0

To add query strings to post permalink you should use the post_link filter in combination with the add_query_arg function. add_filter( 'post_link', 'cyb_append_query_string', 10, 3 ); function cyb_append_query_string( $url, $post, $leavename ) { //Change for the post type you want if ( $post->post_type == 'home' ) { $url = add_query_arg( ...


0

Make sure your webserver has the rewrite module turned on. eg. If using Wamp and Apache: Click Wamp tray icon, Apache > Apache Modules > rewrite module (make sure it is selected). http://www.felfelworld.com/2013/02/12/page-not-found-permalink-wordpress/


0

Note to curators/admin: I wanted to leave a comment but I didn't have enough reputation. I know I am not formally providing an answer, but attempting to help the person asking the question along. Are you using any membership plugins? Can you give us a little more information on the overall site map and functionality? We are seeing a very narrow field of a ...


0

Have you tried adding the third parameter to that call? add_rewrite_tag( '%make%', '([^/]+)', 'make=' );


0

Did you actually create a specific menu and link it to one position you defined in functions.php? Once you do not link it to a position, WordPress grabs all pages and puts it in a menu. You should go like this: 1.) You put something this in the functions.php of your theme in order to register menues (if you only need one, leave out the line with the ...


0

I needed to reset the permalink setting to Default, then change it back to the custom structure I was using. This apparently resets it.


2

I'm not sure but I think that you just need to add two query vars, "group" and "value", not two rewrite tags. Can you try this: add_filter('query_vars', 'cyb_add_query_vars'); function cyb_add_query_vars( $vars) { $vars[] = "group"; // name of the var as seen in the query string and URL $vars[] = "value"; return $vars; } ...


0

I figured out the problem. By adding /. at the end of the category base fixed the problem. So it is news/. instead of news.


0

After see your code, I think that you are trying to redirect the user to the post after publish or update an already published post. Your problem is not with get_permalink() function nor your permalink settings. Your problem is with the logic of your code. See how you set the value of $pl equal to the result of get_permlink but the returned value is the ...


0

You are looking for function get_term_link. Example $my_term_link = get_term_link($cat_lists); Here $cat_lists is term object. Official Documentation


0

It was because my blog is at blah.com/blog but I use the WP API to actually display blog posts on another page on my site. Setting the priority of the filter to PHP_INT_MAX fixed the problem.


0

I found a solution! This is what I did: <?php query_posts(array('orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => 1, 'post_parent' => $page_id, 'post_type' => 'page')); while (have_posts()) { the_post(); ?> <a href="<?php the_permalink(); ?>">Link</a> <?php } ?> <?php ...


0

Please note that if you have lessons that are in multiple chapters you will create duplicate content. If you want an easy way to connect these post types you can use a free plugin called Post Connector: http://wordpress.org/plugins/post-connector/


0

I think you need to include the discipline variable in the custom permalink structure /%discipline%/%postname%


1

If you specifically want to restrict your homepage articles from being accessible via their URL at http://site.com/blog/, then yes, you will need to create a separate post type for them. If, on the other hand, you don't care whether they are accessible by their own URL, but just don't want them to appear along with the "normal" blog posts, then you could ...


1

after you delete a page ,on the "all pages" section, on the top, after the "drafts", there is link to trash, go there and delete it permanently, after this you can change the slug name.


0

Try Howdy_McGree suggestion. If that does not work, try changing your permalink structure, going to that page, resaving it to what you want, and changing your permalink structure back. Sometimes you kinda have to force WP into a reset.


0

Extra bonus Easter Egg for those in need... After the foreach loop by adding... $output .= get_post_field('post_content', $related_post->ID); You will also get the current post content.


0

Ok guys found the solution myself (5 days later, oof) added below to help someone else in the future... foreach((get_the_category( $related_post->ID )) as $category) { $output .= "<a class=\"$category->slug\" href=\"".get_permalink( $related_post->ID )."\" title=\"" . $category->cat_name . "\">" . ...


0

The default post types are post, page, attachment, revision, and nav_menu_item. Replace 'post_type' with 'post': add_action('admin_head', 'wpds_custom_admin_post_css'); function wpds_custom_admin_post_css() { global $post_type; if ($post_type == 'post') { echo "<style>#edit-slug-box {display:none;}</style>"; } } If you ...


0

You can check if the user has left it on the default, i.e. not chosen a permalink scheme, by testing if get_option( 'permalink_structure' ) is empty. I don't think it's polite to just change the user's option for them, especially since they'll need to update their .htaccess or equivalent before it'd actually work. Here's a quick example to put in your ...


-1

this was the answer via htaccess (to be placed in htaccess within the blog.mysite.com directory). RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:blog\.)site\.com$ [NC] RewriteRule ^ http://site.com%{REQUEST_URI} [L,R=301]


0

You can use the Search and Replace plugin to fix the URLs once the new domain is chosen. Likewise, plugins such as BackupBuddy (paid) or Duplicator (free) -- which are very useful for backup, possibly coupled with migration to another server or domain -- also perform this search-and-replace operation.


0

Maybe in the custom_rewrite function, try concatenating $wp_rewrite->rules and $feed_rules using array_merge, then returning $wp_rewrite. function custom_rewrite( $wp_rewrite ) { $feed_rules = array( 'local/(.*?)/(.*?)/?$' => 'index.php?page_id=41&trade=' . $wp_rewrite->preg_index(1).'&area=' . $wp_rewrite->preg_index(2), ...


0

Can you go to Settings/Permalinks and click Save Changes. That will flush the permalinks. You could look at the 'Debug wp_redirect' plugin. Edit: Another idea is to determine what template file is in use. I have a small function plugin that adds debug comments to the header and footer for logged in Editors or Admins. I have uploaded it to pastebin.com. ...



Top 50 recent answers are included