Faced just the task of restricting access to a specific page on a site created on WordPress. Those. the task seems to be simple: if the user has not logged in, he cannot access information on a specific page. But in fact, without picking in the code, implementing it is not so simple.
However – this is Worpdress! Despite the openness of the code, the platform enjoys well-deserved popularity – below is a slice of the popularity of CMS-systems in Runet, on the basis of which the leadership of WordPress is quite obvious:
It is thanks to the openness of the system with the help of plug-ins for inexperienced users in coding that it becomes possible to customize the engine of their own mind. You can solve almost any problem and the problem I mentioned above – restricting access to the page – was perfectly solved with the help of the plugin WP-Members .
The plugin installation process is standard: 1. Download the plug-in to your hard drive 2. Upload via FTP to the server in the folder /wp-content/plugins/ 3. Activate the plugin in the control panel.
Or – go to the link: http://yoursite/wp-admin/plugin-install.php and enter the name of the required plug-in in the search bar: WP-Members, after which we install and activate it.
Immediately after activating the plugin, you will be redirected to the settings page, where you can specify the rules for its use. You can restrict access to both pages and posts on the site. An interesting feature of the plugin is the ability to create an announcement of the record – i.e. an unauthorized user can see the fragment of the record that you highlighted, but get to know the full text only after the registration or verification procedure.
In addition – in the plugin control panel you can specify the address of the user registration and authorization page – a very convenient option if you suddenly want to create an individualized page of this procedure that is different from the standard one in WordPress.
A couple of days ago I ran into a data processing problem, namely – Zennoposter – working with Excel tables obtained from an Excel table. The essence of the problem: 1. We take the data from the cell 2. We process 3. Check the cell on the right – if empty – go down to the line below, if there is data – go to it 4. And so on the cycle …
The complexity of the task was in processing the transition to a cell in an adjacent column. After a few comments in the Zennoposter forum, one night and several experiments, the solution was found simple and elegant:
1. We receive a line and we transfer it to the list 2. We work with each line separately – they took, processed, deleted, and again the cycle.
due to which both the processing speed and the simplicity of the design as a whole have increased.
Sometimes you have to add banner rotator to html sites that is not tied to any network, which is as simple as possible to manage and configure. The code that I present below is very convenient – it is very simple, and should not raise questions.
document.write('alt="' + alt + '" border=0><br>');
document.write('<small>' + txt + '</small></a>');
// End --></SCRIPT>
As you can see from the presented code – the main load lies on a script that generates a random number in a given range (its size is adjusted manually – the code is working on 12 banners). After generating a random number, a given banner is selected and displayed in a layer.
An example of how the code works is available using the link (each time this page is updated, the picture will change randomly – currently there are links to three pictures in the code).