Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call onto a separate header.php?

Tags:

php

wordpress

To be honest I do not understand PHP just yet. But what I am trying to achieve sounds easy in my head.

Here is the code at the top of my wordpress single.php file:

<?php get_header(); ?>

I have created a separate header i.e header2.php.

I want to know what do I need to write at the top of my single.php template to call header2.php instead of header.php?

like image 969
Andrew John Avatar asked Mar 08 '26 07:03

Andrew John


1 Answers

If you want to have header-2.php (and not header2.php) you have to call:

<?php get_header('2'); ?>

See this page: http://codex.wordpress.org/Function_Reference/get_header

like image 94
cheesemacfly Avatar answered Mar 09 '26 21:03

cheesemacfly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!