I want to add a plugin to a live site, but I suspect the pages it creates will need some tweaks. I'd prefer users not be able to access these pages.
I realize I can just hide these page links, but I'd prefer to also have them inaccessible even if the user knows the URL.
How can this be accomplished through .htaccess for numerous Wordpress-generated pages, to disallow all but allow a couple IPs access?
The code I've come across are for directories/explicit files and doesn't seem to work when substituting in the /wordpress-page/ slug name.
Well you don't just want to hide the pages, you also need it to not appear in searches, on category pages etc. So you really need something that works within WordPress. Hiding the pages by IP would only hide the page itself, it would still appear in other areas of the site.
The best way to do this is probably the WordPress visibility feature. It's a core feature so no plugin required. Just set the visibility to private on all the pages and only admins will be able to view them. See the link for more info.
Private – Pages are only visible to blog Editors and Administrators.
Private pages are not visible in the Reader, feeds, or in any search.
A page can be private without being password protected.
Related
I apologize in advance for not having very many examples of effort already put into solving this. I've been googling and racking my brain but I can't even begin to visualize how this should be done.
We have a WordPress site with a Woocommerce store. To put it simply, we will be selling products for various resorts, and each resort will have their own product category to keep everything separate. So for instance if someone goes to https://www.oursite.com/resort-1, it'll be a page with all of Resort 1's products. This is all fine and good.
The problem: for each resort, we also have iPad kiosks that will use Kiosk Pro to display each resort's products and allow them to be purchased. These kiosk versions of the site must be accessible via a subdomain, e.g. https://resort-1.oursite.com. These subdomain versions should start with a landing page, then lead to the expected product listing but with a slightly different look (all via css).
My questions:
How can I set up a subdomain to lead to a specific page without using a multisite?
How can I adjust all links on each page so if someone starts on the kiosk subdomain, they'll stay on the kiosk version no matter where they navigate to?
It strikes me that one way to accomplish this would be to:
a) use htaccess to route to a page with the subdomain passed as a var, for example subdomain.domain.com/page to domain.com/page?sd=subdomain
Mod Rewrite Subdomain to PHP with GET variable
Sub-domain as variable in mod_rewrite
and then;
b) include code in your theme if (sd = sudomain ) {do_something()} where do something uses a different style.css and modifies any html within the page as desired.
I have a multi-site setup and i want to add a global user profile page to all sites. Based on advice i was given i used a page template. I have created a file called myprofile.php and in here it does all the magic to create a page. The problem i have with this is that i must create a page within the WordPress admin panel that uses this template.
With multiple sites on the network I don't want the risk of someone deleting the page from the list or forgetting to add it etc and it causes a bunch of 404 errors, denying users basic functionality.
I want to be able to add a page to my entire WordPress install, including all multi-sites. It needs to be able to do everything that my page template does, but doesn't require a Page to exist in the page listing.
I tried doing this using a php file and using mod_rewrite, calling the WordPress header and footer and this worked, but its returning a 404 error even though the page content is displaying. I was able to manually set the header to 200 using php, but this isn't being picked up by all header scans that i have performed and its not a solution i am particularly happy with. I would like to build this into WordPress rather than making it separate and calling WordPress externally.
Can this be done?
Edit.
In needing a profile page i will also need a login, view other user profile page, change account settings and any other error/account related pages that come with a user profile, so having to create a dozen custom pages for every multi-site is going to be very annoying and messy.
I am also not using the WordPress user database for this as I use the user accounts for various other things outside of WordPress.
I've got a wordpress website, but I'd like it to also work in a way where I can add other, non-wordpress pages and assess them like a normal website. In my case, I have a page in the root of my FTP account: http://puu.sh/3IdDY.png In this case, I want to be able to go to www.labtec901.com/admin.php, which I think I should be able to do, without wordpress coming up and saying it can't find the page: http://puu.sh/3IdI0.png
I'm trying to figure out how a certain WordPress sets things up. I'd like to have a special page where I could make WP calls and interact with the theme, without affecting anything else.
I just making test.php and putting it into my theme's folder, but that doesn't work.
#Eliran provides one possible option, but you could also add a page in the back-end of WP, just make sure it has the slug 'test', and change your 'test.php' filename to 'page-test.php'. If you're worried about the public seeing this, set the page visibility in the admin to 'private'.
Edit:
to move your understanding along a little further also, you should review the way that WordPress determines what file to grab to render a particular URL. This can be pretty confusing to start with, so be patient if you're not familiar with it, but it's at the heart of designing WP themes. I'll link to the examples, and if you scroll down a little there's a diagram that, along with the text, will help you see how WP is 'thinking'.
http://codex.wordpress.org/Template_Hierarchy#Examples
You can see here: Page Templates
all you need to do is create a page named page-{custom-name}.php and add it to the theme folder.
and inside this php file add:
/*
Template Name: My Custom Page
*/
and than to use this page you need to go to the wp-admin, add/edit a page and chose it:
inside the php file everything you do is classic wordpress.
all this is giving you is a custom page tamplate.
Put it in your root folder. When you go to look at it, you'd look at www.mywebsite.com/test.php
It may be other ways to do this, but I rather use the rewrite API and custom query vars, to create custom routes.
A previous answer on the subject can be found here
The basic idea is to add a new url rule, catch the query var with the parse_request filter and maybe do a die or redirect to prevent the default wordpress template from loading.
I prefer this over theme templates, because with templates you need to create a page for each new url, and if that page gets acidentally deleted, that functionality would stop working.
What Pages are Not:
Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog's main page. WordPress Plugins are available to change the defaults if necessary.
Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
Pages are not files. They are stored in your database just like Posts are.
Although you can put Template Tags and PHP code into a Page Template file, you cannot put these into the Page or Post content without a WordPress Plugin like Exec-PHP which Read overwrites the code filtering process.
Pages are not included in your site's feed.
Pages and Posts may attract attention in different ways from humans or search engines.
Pages (or a specific post) can be set as a static front page if desired with a separate Page set for the latest blog posts, typically named "blog."
More About Pages.
In WordPress to add a new page you have to log in to the admin/backend and from the pages menu you can add a new page. In this case, you can select templaes for your page and also you can create a custom page template for that page.
You may read Createing a new page in WordPress. and custom Page template in WordPress.
I am in a critical condition. I was paying a developer in India who left the project but now I need to access the php pages.
I have explored the joomla site using the admin login but i can't find how he is displaying the html/php pages.
Please help!
I assume you're looking for the front-end template for the website.
Using FTP or whatever control panel go to the Joomla folder, look for a folder called templates - it should be one of the folders in there.
To check what the name of the current template is, go to the admin panel and look in the template menu.
If your developer has also made any custom components, the front-end part would be somewhere in the components folder, and the backend bit would be in administrator->components.
You need to read some Joomla tutorials. There are many places that can be used to "display the html/php".
First you have the template files that determine how the site looks and what module positions are available to be used. Generally there is one template in use but there can be multiples.
Next you will have components where the content is entered. At a minimum it is likely that you are using the com_content (articles/categories) and it is very likely there are others being used.
You will also have various modules that will display content in areas outside of the main content area. This will generally include menus, login forms, and other similar content.
Last, plugins can also have an effect on the content. In some cases plugins inject content and in others they replace placeholders with content.
There are a lot of pieces to the puzzle that all come together to display the resulting web page, it's not just a simple question of accessing some files.