use the_content() for specific taxonomy

Hi;
first of, Thank you for a wonderful theme. Love Travelify!

I recently bought a Knowledgebase plugin from Pressapps; but it seems to have an issue with the theme…
When I open a category of the knowledgebase, it shows the excerpt instead of the content?
Knowledgebase
pressapps’ support states:

The issue is that the KB category (taxonomy) uses the_excerpt() instead of the_content() to display content so modify your theme or child theme to use the_content() for knowledgebase_category taxonomy.

But I can’t find the location where to modify, if even possible with travelify(-child)?

if it’s not possible; would it be possible to switch to a premium theme that resembles Travelify & does have this ability?

thank you in advance,

kind regards,
Jo.

Hi Jo,

I hope you are well today and thank you for your question.

That page is handled by the following function so to change it just add the following code in the functions.php file Travelify child theme and edit it however you want.


/**
 * Function to show the archive loop content.
 */
function travelify_theloop_for_archive() {
	global $post;

	if( have_posts() ) {
		while( have_posts() ) {
			the_post();

			do_action( 'travelify_before_post' );
?>
	<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<article>

			<?php do_action( 'travelify_before_post_header' ); ?>

  			<?php do_action( 'travelify_after_post_header' ); ?>

  			<?php do_action( 'travelify_before_post_content' ); ?>

			<?php
			if( has_post_thumbnail() ) {
				$image = '';
	     		$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
	     		$image .= '<figure class="post-featured-image">';
	  			$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
	  			$image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
	  			$image .= '</figure>';

	  			echo $image;
	  		}
  			?>
			<header class="entry-header">
    			<h2 class="entry-title">
    				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?></a>
    			</h2><!-- .entry-title -->
  			</header>

  			<div class="entry-content clearfix">
    			<?php the_excerpt(); ?>
  			</div>

  			<?php do_action( 'travelify_after_post_content' ); ?>

  			<?php do_action( 'travelify_before_post_meta' ); ?>

  			<div class="entry-meta-bar clearfix">
    			<div class="entry-meta">
	    				<?php travelify_posted_on(); ?>
	    				<?php if( has_category() ) { ?>
	             		<span class="category"><?php the_category(', '); ?></span>
	             	<?php } ?>
	    				<?php if ( comments_open() ) { ?>
	             		<span class="comments"><?php comments_popup_link( __( 'No Comments', 'travelify' ), __( '1 Comment', 'travelify' ), __( '% Comments', 'travelify' ), '', __( 'Comments Off', 'travelify' ) ); ?></span>
	             	<?php } ?>
    			</div><!-- .entry-meta -->
    			<?php
    			echo '<a class="readmore" href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'.__( 'Read more', 'travelify' ).'</a>';
    			?>
    		</div>

    		<?php do_action( 'travelify_after_post_meta' ); ?>

		</article>
	</section>
<?php
			do_action( 'travelify_after_post' );

		}
	}
	else {
		?>
		<h1 class="entry-title"><?php _e( 'No Posts Found.', 'travelify' ); ?></h1>
      <?php
   }
}

Best Regards,
Movin

Hi Movin,

i added it to my child functions.php & changed:

/**
 * Function to show the archive loop content.
 */
function travelify_theloop_for_archive() {
	global $post;

	if( have_posts() && is_tax( 'knowledgebase_category' )) {

It’s working it’s working!

Thank you!

You are most welcome here :slight_smile: