On my wordpress site, I have a learning management system plugin and I'm using a theme builder called Thrive Theme Builder.
The LMS creates a dashboard page for users (dashboard.php). The issue is this page ignores all my theming, does not show my theme header or footer and is not the same layout.
After some investigation I found that the theme builder (which in fact is a full theme) uses the singular.php file to show pages. Apparently the page generated by the LMS does not.
This is the code in the theme's singular.php file
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package thrive-theme
*/
thrive_template()->render();
This is the first part of the code from the dashboard.php page created by the plugin
<?php
get_header();
global $wp_query;
$dashboard_page_slug = '';
$dashboard_page_name = '';
if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) {
$dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
$dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
Any ideas how I can get this to work? How do I make the dashboard.php page use my theme settings?
I've tried adding the thrive_template()->render(); to the dashboard.php page but that causes the dashboard to show up inside my theme and inside itself, very strange.
question from:
https://stackoverflow.com/questions/65878320/is-there-a-way-to-force-a-plug-generated-page-to-use-singular-php 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…