Note that there are some explanatory texts on larger screens.

plurals
  1. POLink new php page wordpress
    primarykey
    data
    text
    <p>I'm trying to use bootstrap tabs in my index.php theme to show diferent content in the main page theme. I've implemented the tabs in index.php and create new page called popular-post.php linked in the tab Popular.</p> <p>But when I click in the link to show popular content I get</p> <p>Fatal error: Call to undefined function get_header() in</p> <p>This is the code of my index.php</p> <pre><code> &lt;?php get_header(); ?&gt; &lt;div class="row" id="content"&gt; &lt;div class="col-sm-8 col-md-8 col-lg-8" id="primary"&gt; &lt;ul class="nav nav-tabs"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="&lt;?php bloginfo('template_directory'); ?&gt;/popular-post.php"&gt;Popular&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Recientes&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt; &lt;?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?&gt; &lt;?php endwhile;?&gt; &lt;?php /* Pagnavi plugin support */ wp_pagenavi(); ?&gt; &lt;?php else: ?&gt; &lt;?php get_template_part( 'no-results', 'index' ); ?&gt; &lt;?php endif; ?&gt; &lt;/div&gt; &lt;div class="col-sm-4 col-md-4 col-lg-4" id="secondary"&gt; &lt;?php get_sidebar(); ?&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--/content--&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>An this is the code of popular-post.php</p> <pre><code>&lt;?php /* Template Name: Popular Posts */ ?&gt; &lt;?php get_header(); ?&gt; &lt;div class="row" id="content"&gt; &lt;div class="col-sm-8 col-md-8 col-lg-8" id="primary"&gt; &lt;ul class="nav nav-tabs"&gt; &lt;li&gt;&lt;a href="&lt;?php bloginfo('template_directory'); ?&gt;"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Popular&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Recientes&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="popular_posts"&gt; &lt;?php $pc = new WP_Query('orderby=comment_count&amp;#038;posts_per_page=10'); while ($pc-&gt;have_posts()) : $pc-&gt;the_post(); ?&gt; &lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;p&gt;Posted by &lt;strong&gt;&lt;?php the_author() ?&gt;&lt;/strong&gt; with &lt;?php comments_popup_link('No Comments;', '1 Comment', '% Comments'); ?&gt;&lt;/p&gt;&lt;/li&gt; &lt;?php endwhile; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="col-sm-4 col-md-4 col-lg-4" id="secondary"&gt; &lt;?php get_sidebar(); ?&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--/content--&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload