Forum Replies Created

Viewing 15 replies - 1 through 15 (of 28 total)
  • same here. anyone have any idea why this is happening?

    in my opinion, any repeated segments of the site should be made into separate files if possible and then included in the template file.

    for example, calling on your carousel would be…
    <?php include(TEMPLATEPATH . '/carousel.php'); ?>

    where carousel.php is in your theme folder and has just the carousel code in it.

    i would also like to know how to do this.

    one way to do this would be to create child pages for each section, and then using query_posts you could pull the page. an alternative to using query_posts could be get_pages, with ‘childof’ set as the ID of the current page.

    This didn’t work for me for whatever reason.

    Here is what I pasted in my function.php file in my theme.

    add_filter('request', 'myfeed_request');
    
    function myfeed_request($qv) {
    	if (isset($qv['feed']))
    		$qv['post_type'] = get_post_types();
    	return $qv;
    }

    Does this need to go in the RSS Include Pages plugin?

    I’ve never worked with feeds or RSS files before, so any help in getting this going is greatly appreciated. Thanks!

    Try this. It works for me.

    <?php if ( get_post_type() == 'news' ) {
        //your output
    }; ?>

    i would also like to know how to do this. the above response doesn’t work, as comment_post_ID isn’t in the get_comments() array.

    Thread Starter lukeshumard

    (@lukeshumard)

    Exactly what I needed. Thanks! Here is the final code…

    <?php $eventpostid = $post->ID;
    $eventslug = wp_get_post_terms( $eventpostid, 'venue' );
    $eventvenueslug = $eventslug[0]->slug;
    $eventvenuetitle = $eventslug[0]->name; ?>
    <a href="<?php echo get_option('home'); ?>/venues/<?php echo $eventvenueslug; ?>/"><?php echo $eventvenuetitle; ?></a>

    Thread Starter lukeshumard

    (@lukeshumard)

    The format of the link is in the opening post, that’s correct.

    What I want is on an individual post template. I want the slug of whatever value that post has been tagged with to be displayed in the link. There’s only one value tagged in this taxonomy per post, so there’s no need to worry about lists.

    For example, if this post has a “venue taxonomy value of “Gallery Fun”, then I want the link to be https://www.example.com/venues/gallery-fun. Also, the taxonomy name is “venue” not “venues”, so using get_term_link won’t work, nor would something linking to the actual taxonomy.

    Is that clear? I know it’s a bit confusing and also not the typical use of a taxonomy, but it’s something I need to have done.

    Thread Starter lukeshumard

    (@lukeshumard)

    I’m not trying to create unique pages for these taxonomy values, or link to their respective pages, but to use their slug as a part of a link to a different post within a different category that has the same slug name. Because of that, using get_term_link doesn’t work, and the taxonomy.php template is used for displaying something else totally different.

    Here’s how I’m registering my taxonomies…

    add_action( 'init', 'create_my_taxonomies', 0 );
    
    function create_my_taxonomies() {
    	register_taxonomy( 'venue', 'post', array( 'hierarchical' => false, 'label' => 'Venue', 'query_var' => true, 'rewrite' => array( 'slug' => 'venue' ) ) );
    	register_taxonomy( 'interest', 'post', array( 'hierarchical' => false, 'label' => 'Interest', 'query_var' => true, 'rewrite' => array( 'slug' => 'interest' ) ) );
    };

    Thread Starter lukeshumard

    (@lukeshumard)

    Also, for documentation purposes, here’s my updated code.

    <?php $date_day = date('d');
    		$date_month = date('m');
    		$date_year = date('Y');
    		$today = $date_year . '-' . $date_month . '-' . $date_day;
    	$sidebar_query = new WP_Query();
    	$sidebar_query->query('cat=3&posts_per_page=4&meta_key=Event-Date&meta_compare=>=&meta_value=' . $today . '&orderby=meta_value&order=asc');
        if ($sidebar_query->have_posts()) : while ($sidebar_query->have_posts()) : $sidebar_query->the_post();?>
        	<div class="sidebarentry<?php if(($sidebar_query->current_post + 1) == ($sidebar_query->post_count)) {echo ' bottom';};?>">
            <a href="<?php the_permalink(); ?>"><?php echo get_image('event-photo'); ?></a>
            <p><?php the_title(); ?><br /><?php echo get('Event-Venue'); ?><br /><?php echo get('Event-Date'); ?></p>
            </div>
        <?php endwhile; endif; wp_reset_query(); ?>

    Thread Starter lukeshumard

    (@lukeshumard)

    That actually didn’t work. I had to switch it to…

    query_posts('cat=3&posts_per_page=4&meta_key=Event-Date&meta_compare=>=&meta_value=' . $today . '&orderby=meta_value&order=asc');
        if (have_posts()) : while (have_posts()) : the_post();?>

    Do you know why replacing $wp_query as $sidebar_query didn’t work, where as switching it to query_posts did?

    Thread Starter lukeshumard

    (@lukeshumard)

    Both of them come up empty. Here’s what’s printed for $term = get_terms( 'venue' ); $interestname = $term[0]->slug; echo $interestname;

    Array ( [0] => stdClass Object ( [term_id] => 9 [name] => Venue Name  [slug] => venue-name [term_group] => 0 [term_taxonomy_id] => 11 [taxonomy] => venue [description] => [parent] => 0 [count] => 1 )

    …and this array goes on for the 9 different values I’ve inputted into the “venue” taxonomy. I just need to find a way to figure out what term id in the array is the one I’ve tagged the post with.

    Thread Starter lukeshumard

    (@lukeshumard)

    @alchymyth
    I actually tried that a few days ago and it worked…sort of. the output was a venue, but not the right venue that this post was tagged with in the venue taxonomy. Using <?php $term = get_terms( 'venue' );, I then used print_r($term); to see what my output would be, and it was (sure enough) an array of all the values I had input for “venues.” When I was using $interestname = $term[0]->slug; echo $interestname;, it was echoing the slug value for the first term in the array (obviously).

    I think I’m really close now, but I just need to find someway to identify which term_id the post is tagged with in the specific taxonomy.

    Thread Starter lukeshumard

    (@lukeshumard)

    I was using them in an earlier template (taxonomy archive for a different field, “interests”) when getting a title in the template. I stripped the get_query_var() and used the strings directly, but it still showed blank. I’m not against using some other means of retrieving the data besides get_term_by(), but I don’t know what my alternatives would be.

Viewing 15 replies - 1 through 15 (of 28 total)