Unable to login after changing WordPress site url

Try this First method is Add the above code in wp-config.php define(‘WP_HOME’,’http://localhost/myproject’); define(‘WP_SITEURL’,’http://localhost/myproject’); Second method is Comment Plugins one by one and check. After successfully login update permalink.

URL to Post Archive of Custom Query

Answering my own question seems weird, but here is how I was able to achieve it – function filter_posts_by_id($query) { if ( !is_admin() && is_post_type_archive(‘CPT_NAME’) && $query->is_main_query()) { $post_ids = $_GET[‘post_ids’]; if(!empty($post_ids)) { $pids = explode(‘,’,$_GET[‘post_ids’]); $query->set(‘post__in’, $pids); } } } add_action(‘pre_get_posts’, ‘filter_posts_by_id’); PHP’s predefined variable $_GET[‘parameter’] to get the query string PHP’s explode() to … Read more

Prevent Archive URLs

WordPress generates date archives automatically, it’s just a thing it does. You see the index.php template probably because there isn’t a more specific one for date archives in your current theme. There are plugins that disable these archives, Yoast SEO is one. A quick fix is to empty the date archive rewrite rules: add_filter( ‘date_rewrite_rules’, … Read more

how to set url in admin option page

You can only this link when you register a new post type with the right argument to show it in the admin ui and be available in the menu : $args = array( ‘show_ui’ => true, ‘show_in_menu’ => true, } register_post_type(‘invitation_code’, $args); There’s no really need to have “page=invitation_code” as you are in an edit … Read more

Custome home page url

First of all: this is not at all how websites behave. The standard is that you have some kind of homepage on the root URL /. Now WordPress is customizable and I was able to achieve what you want – at least in most ways. // used to generate the link add_filter(‘page_link’, ‘WPSE_1805_page_link’, 10, 3); … Read more