how to change WordPress URL on all pages? suppose we have a xyz.com. Now I want something like xyz.com/test when customer visiting to xyz.com. and for all newly created pages must be something like xyz.com/test/Newpage.
For example, if your new directory is called application, you would visit www.your-site.com/application/wp-admin or www.your-site.com/application/wp-login.php.
Update /wp-blog-header.php to include your new directory. For example, if your new folder is called application, you would change the file path to this: /application/wp-blog-header.php.
Change this line in the index.php int the root folder.
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
If you want to change the Wordpress URL for all pages then you can follow below step,
Login to WordPress
Open the existing page or create a new page
Enter a Title if necessary
Save the page, this will automatically create a URL
Look directly under the title field, you will see Permalink: followed by the URL
Click the Edit button behind the link
Type in the new URL and click OK
Save the page or post
Customize Permalink Structure, You can choose "Post name" option.
Post name - An example of the post name structure is http://www.sample.com/sample-post
Hope this will helps you.
Related
Have created a custom template page on my wordpress file folder through cpanel named user-dashboard and it includes 5 files on .php so, how do I make sure that every guest accessing any page on user-dashboard folder (e.g user-dashboard/settings.php) will be redirected to example.com/login and login wordpress account.
after your page creation process complete you add the below lines in function.php file
function user_default_page() {
return '/user-dashboard';
}
add_filter('login_redirect', 'user_default_page');
One more thing is set your page can view after session set and your page path should equal of return path.
I'm trying to create a custom Wordpress Plugin for one of my websites. And I've created a shortcode inside the plugin and I have one .swf file inside the plugin directory that I want to embed using the created shortcode. I've tried with <embed src="wp-content/plugins/myplugin/obj.swf"> also tried with <iframe> but I get 404 Page not found error. The same error when I try to open the swf file directly from the browser's address bar. Can anyone give me little hand how can I achieve this?
Based on our comments, and the screen shot, you should rename the folder on the server to be in lower case (ie from falja-e-namazit-WP to falja-e-namazit-wp).
EDIT
Not sure what you mean by your latest comment, but you should be able to get the URL of your asset using the plugins_url() function. Assuming your SWF file is in /wp-content/plugins/falja-e-namazit-wp/assets, the following code (in /wp-content/plugins/falja-e-namazit-wp/falja-e-namazit-wp.php) should return its URL:
$swf_url = plugins_url( 'assets/falja.swf', __FILE__ );
I have created html pages and trying to convert into wordpress theme,how to link html one page to other page in wordpress menu bar
sample code :
Features
this code is not working,it 's showing page not found.how to make this link in wordpress using php code.
Firstly Create Page "Features" from wp-admin.
Create template for this page.
http://codex.wordpress.org/Stepping_into_Templates
To set this page in menu Go in "Menu" section in WordPress.
http://codex.wordpress.org/Appearance_Menus_Screen
To view this menu in fronted use wp_nav_menu()
Take example template from your theme.
This is file in theme ending with -page.
Change template name in head of a file.
Then remember about the_loop all should be inside a loop to work correctly with many pages.
Put html there, also in header.php attach css to this html.
Page structure is like, header in the up, then page and then footer.
Remember to preserve good html structure - divs beginning and ending.
Then you create a page with content ( which is presented in the_loop ) , which has its own url address.
You can set url naming of pages in settings -> permalinks, you may need to write to .htaccess file.
Then you have direct url to page. You can use it in code like this:
echo bloginfo('url'). 'nameofpage';
All to do is create a template and assign it to page ( on page edit page template option ).
You can use pages or posts for this, i prefer pages.
Create new pages or posts and get their ID.
For linking its:
Get link with this:
get_permalink( $yourPostOrPageID ); // only get; not echo
Otherwise
Wordpress homepage link:
get_bloginfo('home');
Category or custom taxonomy term link:
get_term_link( $term, $taxonomy );
I am new in WordPress. I installed plugin "html-on-pages". This plugin add ".html" after page name in URL.
I added some pages in my WordPress project.
I want to remove '.html' in some conditions for some pages. I try to get name of page using $wp_rewrite of WordPress but not found any way.
Please suggest any way that return name of page or any function of WordPress that will return name of page.
Try this
$page_name = basename(get_permalink());
I am creating a site in which I would like to go to another page via a custom menu. My menu code for the views/layout/main.php is:
array('label'=>'create wireframe', 'url'=>array('wireframes/create'), 'visible'=>!Yii::app()->user->isGuest),
A user can go to the wireframe creation page, but it passes the url index.php?r=user/wireframes/create
but I only want index.php?r=/wireframes/create. How can it pass the url? Are there any additions that I missed?
I guess you can try
'url'=>array('/wireframes/create').