Theme function in functions.php
-
I have created a function in the theme functions.php
function display_techincal_info() {
// code here
echo “Blah Blah Blah”
}and I call the functions in my template pages using
<?php display_techincal_info(); ?>
but it doesn’t call the function. Not being 100% aux fait with how wordpress works, I added the code
add_action( ‘init’, ‘display_techincal_info’ );
as I had done for my custom posts, but that didn’t work either. Now I know there is nothing wrong with the code within the function becuase I am currently using it already on the same page. I just now wish to use it on more than one page – so it makes sense making it a function, and calling it from all the pages I wish to display the output….
How do I declare the function in functions.php and how do I call it?
thanks…
The topic ‘Theme function in functions.php’ is closed to new replies.