PHP area inside wordpress page

I have a company page designed using Joomla, and inside it is an administrative area developed in PHP. Only users with certain privileges partnerand partner_employeescan access this area.

I need to transfer the front site to Wordpressand keep the same behavior in a limited area using login from Wordpress.

Is it possible?

Where should I put a directory from this restricted area?

How do I place links on a page Wordpresspointing to this area?

+4
source share
1 answer

wp, My Account, PHP, (Joomla ) wp,

wp template, includes . : https://developer.wordpress.org/themes/basics/template-files/ https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

-, wp page template link menu. : https://codex.wordpress.org/Pages

, Wordpress, , :

, , : https://codex.wordpress.org/Roles_and_Capabilities

( ):

 <?php
/**
 * Template Name: My Account Page Temp
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

<?php if ( is_user_logged_in() && current_user_can( $capability ) ): ?>

 //render your restricted area content          

<?php else : ?>

// Redirect him for login

<?php endif; ?>

. template parts main template . : wp-content/themes/twentyfourteen/myaccount

<?php get_sidebar(); ?>
<?php get_template_part( 'featured-content' ); ?>
<?php get_footer(); ?>

, .

+5

Source: https://habr.com/ru/post/1652385/


All Articles