• Hi all,

    I’m trying to target single posts within a certain category. In those single posts within that category, I want to display additional info, which works.

    My problem is that I can’t target that specific category; the additional info displays on all single posts. I’m sure my category id = 3. Here’s what I have:

    /* adding transcript and sponsor custom fields */
    	function additional_post_info() {
    		if ( is_category('3') ) { ?>
    		<div class="additionalPostInfo">
    			<h3>Transcript</h3>
    			<div class="transcript">
    				<?php the_field('interview_transcript'); ?>
    			</div>
    
    			<div class="sponsors">
    				<h3>Sponsors</h3>
    				<?php the_field('interview_sponsors'); ?>
    			</div>
    		</div><!-- additionalPostInfo -->
    	<?php }
    	}
    	add_action('thesis_hook_after_post','additional_post_info');

    I’ve also tried
    if ( is_category('3') && is_single() )

    which also is not working.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    I have the same problem, I want to customize some category pages, like this :

    function custom_archive_info() {
    	if (is_category('equipamiento')) { ?>
        <div class="post_box top intro_block">
            <div class="headline_area">
            	<h1><?php single_cat_title(); ?></h1>
            </div>
            <div class="format_text">
            	<p>text goes here</p>
            </div>
        </div>
    <?php }
    }
    remove_action('thesis_hook_archive_info', 'thesis_default_archive_info');
    add_action('thesis_hook_archive_info', 'custom_archive_info');

    I hope you can help.
    Thanks

    @clegeard: It is impolite and contrary to forum policy to interrupt another poster’s ongoing thread with a question of your own. Please post your own topic.

    Sorry I thought we had the same problem !

    Thread Starter dbcuadro

    (@dbcuadro)

    @clegeard the answer to my issue was to use in_category && is_single. i don’t think we have the same issue.

    also try the thesis forums, they might be able to help better.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Thesis / using is_category in custom_functions not working’ is closed to new replies.