Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1111094
    Praxis Research
    Participant

    Hey,

    I wanted the author shortcode active on author pages, so I added this code to my child theme as author.php a long time ago:

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/WP-INDEX.PHP
    // -----------------------------------------------------------------------------
    // Index page output for Renew.
    // =============================================================================
    
    ?>
    
    <?php get_header(); ?>
    
      <div class="x-container max width offset cf authorpage">
        <div class="<?php x_main_content_class(); ?>" role="main">
    <div class="author"><?php echo do_shortcode( '[author]' ); ?></div>
          <?php x_get_view( 'global', '_index' ); ?>
    
        </div>
    
        <?php get_sidebar(); ?>
    
      </div>
    
    <?php get_footer(); ?>

    It worked before, but I recently found the page doesn’t load at all anymore. I renamed the custom PHP file to deactivate it, and the normal author page loaded, so there must be a problem with the custom code. Could you help me fix it?

    #1111268
    Rad
    Moderator

    Hi there,

    Try replacing this line,

    <div class="author"><?php echo do_shortcode( '[author]' ); ?></div>

    with this new line,

    <div class="author"><?php echo do_shortcode( '[x_author]' ); ?></div>

    Hope this helps.

    #1111755
    Praxis Research
    Participant

    Blank page still. It’s worth mentioning that, even if I remove the shortcode bit, the page still doesn’t load. I don’t think the problem is with the shortcode bit. Even simply copying VIEWS/RENEW/WP-INDEX.PHP to the child theme as ‘author.php’ breaks the author pages. Maybe it would help if I knew where the PHP file is that’s actually being used to build the default author pages?

    #1111777
    Lely
    Moderator

    Hi There,

    Your code is correct. Above code is working when I doubled check. I did save the code as author.php and then save it on x-child folder.

    If what you’re having us white blank page, a white screen usually means there is a fatal PHP error. Can you please enable WP_DEBUG mode? You can do this by opening wp-config.php and adding
    define( 'WP_DEBUG' , true ); just above /* That's all, stop editing! Happy blogging. */ For example:

    define('WP_DEBUG', true);
    
    /* That's all, stop editing! Happy blogging. */

    When you revisit the page with the white screen, you should have some error output describing the issue in more detail.

    If not, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1112280
    Praxis Research
    Participant

    This is what the debug shows:

    Notice: Undefined variable: file in /home/praxisre/public_html/wp-content/plugins/fix-my-feed-rss-repair/rss-feed-fixr.php on line 14
    
    Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /home/praxisre/public_html/wp-includes/functions.php on line 3897
    
    Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). === Trace: #6 /home/praxisre/public_html/wp-content/plugins/bp-you-are-blocked/buddypress-block.php(39): is_user_logged_in() #7 [internal function]: bpb_load_plugin('') #8 /home/praxisre/public_html/wp-includes/plugin.php(525): call_user_func_array('bpb_load_plugin', Array) #9 /home/praxisre/public_html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(35): do_action('bp_include') #10 [internal function]: bp_include('') #11 /home/praxisre/public_html/wp-includes/plugin.php(525): call_user_func_array('bp_include', Array) #12 /home/praxisre/public_html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(305): do_action('bp_loaded') #13 [internal function]: bp_loaded('') #14 /home/praxisre/public_html/wp-includes/plugin.php(525): call_user_func_array('bp_loaded', Array) #15 /home/praxisre/public_html/wp-settings.php(277): do_action('plugins_loaded') #16 /home/praxisr in /home/praxisre/public_html/wp-includes/functions.php on line 3897
    
    Notice: Constant BP_AVATAR_FULL_WIDTH already defined in /home/praxisre/public_html/wp-content/themes/x/framework/functions/global/plugins/buddypress.php on line 28
    
    Notice: Constant BP_AVATAR_FULL_HEIGHT already defined in /home/praxisre/public_html/wp-content/themes/x/framework/functions/global/plugins/buddypress.php on line 29
    
    Notice: The called constructor method for WP_Widget in GTags_Widget is deprecated since version 4.3.0! Use
    
    __construct()
    
    instead. in /home/praxisre/public_html/wp-includes/functions.php on line 3718
    
    Notice: The called constructor method for WP_Widget in GTags_Activity_Widget is deprecated since version 4.3.0! Use
    
    __construct()
    
    instead. in /home/praxisre/public_html/wp-includes/functions.php on line 3718
    #1112319
    Rupok
    Member

    Hi there,

    It looks like your issue is related with a plugin (fix-my-feed-rss-repair). Let’s deactivate this and check again. You can remove the plugin folder from /wp-content/plugins/

    Thanks!

    #1112335
    Praxis Research
    Participant
    This reply has been marked as private.
    #1112359
    Rupok
    Member

    Hi there,

    The author page seems blank and there is no error. Did you disable the debug mode or removed the plugin?

    Let us know.

    #1112409
    Praxis Research
    Participant

    I disabled debug mode. Since the site is live, I don’t want to leave debug mode on for any long period of time. I had deleted the plugin folder, but, when the problem persisted even with the plugin gone, I restored it.

    #1112960
    Friech
    Moderator

    Hi There,

    Would you mind providing us an FTP credentials with an access to the WP installation files? So we can take a closer look. Seems the one you provided above has only limited access.

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1113077
    Praxis Research
    Participant
    This reply has been marked as private.
    #1113263
    Rupok
    Member

    Hi there,

    That file doesn’t contain FTP password. Kindly provide correct FTP credentials :

    – FTP host name
    – FTP username
    – FTP password

    You can ask your hosting provider for help.

    Thanks!

    #1113879
    Praxis Research
    Participant

    [Blah]

    #1113930
    Praxis Research
    Participant

    I disabled the custom author page php and added to functions.php this code I found here on the forums:

    // Show Author Box on Author Page
    // =============================================================================
    
    function add_author_meta() {
      if ( is_author() ) {
        $id = get_the_author_meta( 'ID' );
        echo do_shortcode('[x_author id="'.$id.'"]');
      }
    }
    
    add_action('x_before_view_global__index', 'add_author_meta');

    Works perfectly. Thanks for your help. ^_^

    #1113966
    Rupok
    Member

    You are welcome!

    Glad that you sorted it out. Feel free to let us know if you face any other issue. We’ll be happy to assist you.

    Thanks for using X.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1111094 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>