Author profile pages does not pick the proper template

Hi there again,

using twenty twelve (wich is my theme father), if you have archive-question.php in your theme folder this template is pick by the "question/user/xxx" url (in my case is translated in each subsite). Instead of showing the profile page with the activity in the Q&A an archive page with no sense information appears.

Even removing the archive-question.php file from the theme, the information that appears in the profile page is incorrect...

Please let me know some fix.

Thanks again,
Best regards.

  • Ivan Shulev

    Hey ARTURO ,

    I hope you are having a nice day so far and I am sorry for the delay here!

    I was able to replicate this issue, but it appears to get fixed when I remove/rename the archive-question.php file.

    Since this is not the case for you, please send over FTP credentials so I could have a look on site.

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic.

    Send in:

    Subject: "Attn: Ivan Shulev"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Thank you and I wish you an awesome day ahead!

    Ivan

  • Ivan Shulev

    Hey ARTURO ,

    I logged into your server via FTP and in the theme iol I found archive-question.php, which I have renamed to renamed-archive-question.php and now there is a blank page. The error I saw after enabling WordPress debugging (https://codex.wordpress.org/Debugging_in_WordPress#Example_wp-config.php_for_Debugging) is the following:

    [31-May-2016 13:18:02 UTC] Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as reference_ID, ID, ROUND(0 + (MATCH (post_content) AGAINST ('')) * 1 + (MATCH ' at line 1 de la base de datos de WordPress para la consulta (SELECT  as reference_ID, ID, ROUND(0 + (MATCH (post_content) AGAINST ('')) * 1 + (MATCH (post_title) AGAINST ('')) * 2 + (1 = 0) * 1,1) as score
     from wp_posts
    left join wp_term_relationships as terms on ( terms.object_id = wp_posts.ID )
     where post_status in ( 'publish', 'static' ) and ID != '' and post_password =''  and post_type = 'topic'
     group by ID
     having score >= 1.00 and ID != 0 order by score desc limit 5) realizada por require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iol/template-tipos-lentes-intraoculares.php'), include('/themes/iol/nc-yarpp-full-side.php'), yarpp_related, YARPP->display_related, YARPP_Cache_Bypass->begin_yarpp_time'
     group by ID
     having score >= 1.00 and ID != 0 order by score desc limit 5) realizada por require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iol/template-tipos-lentes-intraoculares.php'), include('/themes/iol/nc-yarpp-full-side.php'), yarpp_related, YARPP->display_related, YARPP_Cache_Bypass->begin_yarpp_time

    I believe this comes from the theme iol but am not sure where exactly.

    In case you want to return back to the previous version of your site, you can rename the file renamed-archive-question.php back to archive-question.php.

    I hope this helps and I wish you an awesome day ahead!

    Ivan

  • ARTURO

    Hi Ivan,

    thanks your for your support.

    Finally I got the site working the following way:

    1) I removed the archive-question.php in my theme and changed its name for qa-archive-question.php

    2) I have put some conditionals in my archive.php file:
    if(($wp_query->query_vars['taxonomy'] == 'question_category') || ($wp_query->query_vars['taxonomy'] == 'question_tag')){
    include( ABSPATH . 'wp-content/themes/iol/qa-archive-question.php');
    die();
    }
    if(($wp_query->query_vars['post_type'] == 'question') && ($wp_query->query_vars['author_name'] == '') ){
    include( ABSPATH . 'wp-content/themes/iol/qa-archive-question.php');
    die();
    }

    if(($wp_query->query_vars['post_type'] == 'question') && ($wp_query->query_vars['author_name'] != '')){
    include( ABSPATH . 'wp-content/themes/iol/qa-user-question.php');
    //Note in qa-user-question.php I left the main loop so user-question.php template in the plugin folder is "taken".
    die();
    }

    3) In user-question within the default-templates folder in the plugin, I modified the markup of user-question.php to fit with the previous version.

    I have not find a way to have user-question.php template working within my theme folder correctly so I will need to be alert for the following update.

    If you have any other idea please share it with me.

    Thanks again for your time!!

  • Ivan Shulev

    Hey ARTURO ,

    I hope you are having a nice day so far!

    First of all, I tried logging in to your site via FTP, but was getting incorrect login credentials error. Did you delete the FTP user you created for me?

    Also, I will need a bit of clarification, regarding your last post.

    I have not find a way to have user-question.php template working within my theme folder correctly so I will need to be alert for the following update.

    What exactly is not working and what would you like to achieve?

    Thank you for clarifying and I wish you an awesome day ahead!

    Ivan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.