Hello Jonny,
Thanks for writing in!
You will have to add your custom functions in your child theme’s functions.php file. For example;
<?php
// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to X in this file.
// =============================================================================
// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
// 01. Enqueue Parent Stylesheet
// 02. Additional Functions
// =============================================================================
// Enqueue Parent Stylesheet
// =============================================================================
add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
// Additional Functions
// =============================================================================
// Custom Function
function nameofyourfunction(){
// process here. Make sure the correct open and close bracket are added on the function.
}
And then you call your custom function in the template file like the wp-single.php file
<?php
// =============================================================================
// VIEWS/INTEGRITY/WP-SINGLE.PHP
// -----------------------------------------------------------------------------
// Single post output for Integrity.
// =============================================================================
$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
get_header();
?>
<div class="x-container max width offset">
<div class="<?php x_main_content_class(); ?>" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( 'integrity', 'content', get_post_format() ); ?>
<?php x_get_view( 'global', '_comments-template' ); ?>
<?php endwhile; ?>
<?php nameofyourfunction(); ?>
</div>
<?php if ( $fullwidth != 'on' ) : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
These codes were all just examples used for explaining where you can place the custom codes. We would love to know if this has worked for you.
Thank you.