• 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 ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jawad Ahmad

    (@jawad_mayo)

    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 );
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘RSS Error’ is closed to new replies.