A simple delete plugin and re-install did not solve the problem either.
Make sure your permalink is set to Post Name. And the place to really check is the /templates/ura-template-loader.php as that is where the templates are called and checked for my templates or WordPress templates. Resetting the permalink should take care of it, if not then try the function ura_template_loader in the file mentioned previously, there are a few commented out wp_dies in that function for testing or add your own. That is where my template gets called and fires and it is not firing apparently.
Hi again.
My permalink is set to Post Name.
I’ve put some die / print / print_r here and there. With print_r on the $post object I get these values:
WP_Post Object
(
[ID] => 225
[post_author] => 1
[post_date] => 2017-03-09 01:12:53
[post_date_gmt] => 2017-03-08 23:12:53
[post_content] =>
[post_title] => Email Confirm
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => ura-email-confirm
[to_ping] =>
[pinged] =>
[post_modified] => 2017-03-11 14:08:09
[post_modified_gmt] => 2017-03-11 12:08:09
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://www.[subdomain].[domain].[topdomain]/ura-email-confirm/
[menu_order] => 0
[post_type] => page
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[ura_post_type] =>
)
It looks to me ura_post_type is empty in this case so nothing is assigned to $post_type.
Then I added print (“URA_THEME_URL: ” . URA_THEME_URL ); a bit further down and got this back:
URA_THEME_URL: /home/[username]/[subdomain].[domain].[topdomain]/wp-content/plugins/user-registration-aide/themes/
Since $post_type is empty then this is never true:
if ( $post_type == ‘ura-page’ )
Maybe this could have picked up
if( empty( $template ) ){
…but I added this line after the if:
else { print ( “empty template” ); }
… which printed out the empty template text.
Is this fully expected?
Well if you can you can look into the database for posts and see if it added the ura_post_type field to the table, but the if( empty( $template ) ){ was added in case it hasn’t been added.
And are you using the latest version, as the latest version should compensate for the ura_post_type not being added with the empty $template logic. Uncomment the wp_die array key exists and see what happens. And you can try to add the ura-page to the posts table for the page in the posts db and see if that works too. Uncomment out the wp_die( ‘POST TYPE’ ) on line 47 of ura-template-loader.php and see if that does anything too. Outside of that not sure what to tell you outside of that without being able to look at it directly.
One other thing, there is this code starting around line 46 of the ura-template-loader.php file:
if ( $post_type == 'ura-page' ){
//wp_die( 'POST TYPE' );
$template = URA_THEME_URL.'page.php';
}
if( empty( $template ) ){
if( array_key_exists( $post->post_name, $templates ) ){
//wp_die( 'ARRAY_KEY EXISTS' );
$template = URA_THEME_URL.'page.php';
}
}
Change that to this:
if( !empty( $post_type ) ){
if ( $post_type == 'ura-page' ){
//wp_die( 'POST TYPE' );
$template = URA_THEME_URL.'page.php';
}else{
return $template;
}
}else{
if( array_key_exists( $post->post_name, $templates ) ){
//wp_die( 'ARRAY_KEY EXISTS' );
$template = URA_THEME_URL.'page.php';
}else{
return $template;
}
}
That should better cover the logic for the event that the ura-post-type is empty instead of what I had.
Hi again.
I am currently running 1.5.3.7.
Asking me to check the database for the ura_post_type did the trick. It turned out that the column was null for all rows. So I did this:
update wp_posts
set ura_post_type= ‘ura-page’
where post_name like ‘ura%’
… and then the code fell into the right if-statement.
I could probably also have used the logic you’ve provided but I guess it would be overwritten on the next plugin update.
Now the Email Confirmed page seems to be messing up the page a bit but that’s another discussion. π
Thanks a lot for your help!
As I recall using the regular theme did create issues when I was first developing that section and I knew very little about theming at the time. The templates now use a generic theme template as I was unfamiliar with those but will look into it in the next update or see about using the current theme styling instead and see if I can get the to work properly, however it is difficult with so many theme options out there so there will always be some issues with doing it that way as well but let me check on it.
-
This reply was modified 9 years, 2 months ago by
bnovotny.