WordPress.org

Ready to get started?Download WordPress

Forums

RSS Error (3 posts)

  1. jawad_mayo
    Member
    Posted 1 year ago #

    I am getting the following error when I try to open the feed link of my websire Error : Warning: Cannot modify header information - headers already sent by (output started at /home/kaifbrim/public_html/veterinaryhub.com/wordpress/wp-content/themes/SimpleVeterinaryHub/functions.php:26) in /home/kaifbrim/public_html/veterinaryhub.com/wordpress/wp-includes/pluggable.php on line 876

    Any solution ?

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

  3. jawad_mayo
    Member
    Posted 1 year ago #

    Ok. Found the origin of error , in the following code this line is the error "$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;". Do you think that I should add reset_query(); at the end of this function ? This is what I am getting from this all.
    //for pagination
    function paginate() {
    global $wp_query, $wp_rewrite;
    $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;

    $pagination = array(
    'base' => @add_query_arg('page','%#%'),
    'format' => '',
    'total' => $wp_query->max_num_pages,
    'current' => $current,
    'show_all' => true,
    'type' => 'list',
    'next_text' => 'Next Page»',
    'prev_text' => '« Previous Page'
    );

    if( $wp_rewrite->using_permalinks() )
    $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );

    if( !empty($wp_query->query_vars['s']) )
    $pagination['add_args'] = array( 's' => get_query_var( 's' ) );

    echo paginate_links( $pagination );
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags