Hi there,
The way TotalPress is constructed is with hooks and filters. This allows the end user to easily manipulate the way things work in the theme.
All of these hooks and filters are located in a file called template-functions.php
. This file is located in totalpres > assets > inc
. A few others are located in a file called totalpress-extras.php
. This file is located in the same folder as mentioned before.
These hooks are called in different theme files. For example, the loop was turned into an action called totalpress_main_loop
and this is called in the archive.php
and index.php
files.
Another reason why hooks and filters were used to create TotalPress is so that the end user did not have to copy any files into their child theme. All they would have to use is the functions.php
file to add their own hooks and filters and to overwrite any existing ones.
So basically what you need to do is or what I recommend you do create a child theme if you haven’t already done so. Then turn the query above into a hook
, like this:
// my specific author hook
if ( ! function_exists('build_posts_from_specific_author')) :
function build_posts_from_specific_author() {
$args = array(
'author_name' => 'Bedrich',
'post_type' => 'my-custom-post',
'meta_key' => 'color',
'meta_value' => 'blue');
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h1 href="<?php the_permalink(); ?>"><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php
}
add_action('posts_from_specific_author','build_posts_from_specific_author');
endif;
Add the code to the child theme functions.php
file and then call it where you need to like so:
<?php do_action('posts_from_specific_author'); ?>
I hope this helps, without knowing the actual specifics of how you’re going to display these posts or where you’re going to display these posts this about all I can offer.
If possible, you can contact me via ThemeAWESOME.com and I can help you get this sorted if you like.