How to remove the slug of a theme in wordpress URL - wordpress

Here is the url in browser i want to change tu.edu.pk/#kingster-moblie-menu to tu.edu.pk/#tu-moblie-menu
Please Hepl me out how to reslove this issue.

You can try this js on your js file
// Replaces the location of the current window with the new one.
window.location.replace("https://www.tu.edu.pk/#tu-moblie-menu");

Related

Wordpress Rewrite custom URL file name with param

I'm facing some troubles with htaccess rewites with Wordpress
I want this URL:
https://example.com/results.php?id=xxx
To fetch this URL:
https://example.com/index.php?op=results&id=xxx
basicaly the problem is catching the first URL
i tryed this snippet
add_rewrite_rule( 'results.php?$', 'index.php?results=$matches[1]', 'top' );
It works, but an unwanted slash is added like so:
https://clients.lab/esallamlab/results.php/?id=123
Note the (/) after (results.php)
Any help please!
I do not think it has anything to do with '.htaccess' file. This is how I solved this for my website
1- Go to the admin panel --> go to settings --> permalinks
2- In the 'Custom structure' section, delete the last slash/ at the end.
3- Save changes and you should be able to see the right url
https://example.com/results.php?id=123

Wordpress: Using relative URLs in the Menu using Custom Links

When I try to use relative URLs when creating menus in Wordpress...Wordpress always prepends "http://" to the relative path after I click Save. How do I prevent Wordpress from prepending the "http://" in the URL field?
I think I read to change a bit of code in wp-includes/nav-menu.php, but I'd prefer not changing any core code...just in functions.php if necessary.
Any ideas?

Change a specific url to other url in wordpress using function or htaccess

Hi i have a woocommerce product and its url is http://localhost/project/product/my-product/
For this specific url i want to change the url in to
http://localhost/project/my-product/ .
Or some one take http://localhost/project/my-product/ he need to see http://localhost/project/product/my-product/ content without changing .
Is that possible using htaccess or any othe function
you can hook up into redirect rules, here is an article for that https://rudrastyh.com/wordpress/change-specific-urls.html

How Link Wordpress Image Files from js

I am developing a site into sub dirctory-
sitename.com/subdirectory/
I am including an image link from my theme js file.(js/custom.js)
sitename.com/subdirectory/wp-content/uploads/2014/05/333.png
But when i move the site to main directory. I want the sitename.com/subdirectory/ will automatically converted to http://sitename.com/
is that possible? I try to used
/wp-content/uploads/2014/05/333.png
but its not working.
you should do js code in your php script before including script file.
var image1= '<?php echo content_url();?>/uploads/2014/05/333.png';
Then use this variable image1 in your js file.
This will solve your problem.
You can get the current URL by javascript from this Get current URL in web browser
Then check if current URL in subdirectory or not then you can decide what link should to pass to your image link in javascript file

How can I change the WordPress archive URL pattern?

I have an archives section in the right sidebar. You can check here. By default, the archive section gives the /blog/2012/08/ URL pattern.
But I want the /blog/archive/2012/08/ pattern without changing the Permalink pattern as the main posts using blog/post_name, and it should not be changed. How can I get this done?
I am new to WordPress.
Tonight I come to this question with no answer. Although it's quite late to answer, but I try to answer it for future reference.
You can add following code snippet to functions.php file.
function change_archive_links() {
global $wp_rewrite;
// add 'archive'
$wp_rewrite->date_structure ='blog/archive/%year%/%monthnum%/';
}
add_action('init','change_archive_links');
Don't forget to flush WordPress rewrite rules after adding the snippet. To do that, go to WP Dashboard > Settings > Permalinks and press Save Changes button.

Resources