Custom post url in search.php isn’t the correct rewrited url

Solved, it was an issue with assigned parent- and subcategories. Because I’m using the ‘WP All Import’ plugin connected to Google Drive, posts are automatically imported. Since some of the posts don’t have categories assign in the Google Drive document, ‘WP All import’ doesn’t assign a category on importing the data. For some reason this … Read more

How to use a custom field with add_rewrite_rule()?

You should use ‘post_type_link’ hook and register post type ‘project’ with (‘with_front’ => true) parameters ‘rewrite’ => array(‘slug’ => $slug, “with_front” => true), ==================================or===================================== add_rewrite_rule(‘^project/([0-9a-z]+)/?$’, ‘index.php?project=$matches[1]’, ‘top’); ==================================================================== function post_type_link_hook($link, $post) { add_rewrite_tag(‘%url_id%’,'([^&]+)’); if (‘projects’ == get_post_type($post)) { $urlId = get_post_meta($post->ID, ‘url_id’, true); //Lets go to get the parent cartoon-series name return str_replace(‘%url_id%’, $urlId, $link); … Read more

How to pass a more variable with page/subpage in Wordprees URL?

function add_custom_query_var( $vars ){ $vars[] = “q”; return $vars; } add_filter( ‘query_vars’, ‘add_custom_query_var’ ); mydomain/how-we-work/our-process/?q=more-value You can handle it with get_query_var( ‘q’ ); Edit1: If you want to use with ‘SEO URL’ you need to add_rewrite_rule function add_rewrites(){ add_rewrite_rule( ‘^how-we-work/our-process/([^/]*)/?’, ‘index.php?pagename=how-we-work/our-process&q=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘add_rewrites’ );