Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter binarybit

    (@binarybit)

    thanks for your suggestions. I will give this a try as well but I ended up going with a jquery plugin which simplified things for my needs.

    Thanks guys for your assistance here but I was just using that taxonomy image as one example.

    Without going into a great deal of details… I need custom meta values for various areas. For example… regarding the Washington Post one… I wanted to have a page dedicated to that specific term on which I can show a bunch of meta fields/details on each news source (an image being one of them).

    I am almost shocked that this is not available…?..!

    I thought I read somewhere that the wp-users database and the categories database now allows for additional custom meta fields to be assigned… Am I wrong with this?

    Anyone happen to know if I could just trick the “description” field into thinking its the “meta” data field, removing it from the admin UI and creating my own meta field essentially replicating the same functions used for post types?

    Sorry for this longer post but this is the only place I feel smart people might visit who can advise me to my taxonomy issue:

    I am attempting to achieve something which I thought would be really simple with wordpress 3.0 but it seems to be far more complicated than I originally thought. My hope is that someone (maybe you: nicomollet) can correctly provide me some example code on how to achieve this.

    In its most basic element lets just say that I am creating a custom post type for “news” which I have in place already. Now… all I want to really be able to do is create a simple drop down where the author selects the news “source”. For example one entry would be the “The Washington Post”.

    Up to this point I think everything works perfectly fine but were my complication comes into play is that I want to associate a custom thumbnail image with each of these new sources.

    Now… my hope was that I could setup each “new source” as a taxonomy entry so I could manage of all of them from one interface but it seems that each taxonomy can’t have any custom meta-fields associated with it.

    Just to clarify this once more: I believe the solution is creating a custom meta box with the ability to upload a image and associate it with a specific entry to specific taxonomy group (in this case news sources).

    Naturally it would of course be possible to add such a meta box directly into the custom post type for “news” or hard code it into the post type but this won’t work for me because news sources are being added all the time.

    By being able to have custom fields associated with each taxonomy entry I would be able to just query the custom fields for that taxonomy and present the applicable image.

    Am I loosing my mind here or is this really not possible? If not I would be shocked because there are so many areas where I would see such functions as highly valuable.

    If ANYONE might be able to provide me with what I need to enter into my functions.php file to make this work I would GREATLY GREATLY appreciate it!

    BTW – nicomollet… excellent writeup, this helped me out a great deal. The only thing I believe you did not cover which I was always curious about was the actual system load these plugins have when comparing them to one another and then comparing the use of using a plugin compared to writing the code in manually into your functions.php file… anyone have any comment on this? I am always worried about when systems like this start bogging down the entire site…

    Thanks in advance to anyone who might respond here!

    bump

    Thread Starter binarybit

    (@binarybit)

    bump…?

    Thread Starter binarybit

    (@binarybit)

    Is this really the only options… there is nothing which lets me create a type of list template for a post type??? I find this hard to believe that they did everything except for that for simple integration of these type of posts…

    is this the solution?

    Thread Starter binarybit

    (@binarybit)

    BTW – I “think” it is important to note that in my original code I was first doing a call to get ALL of the posts and in the second part I am telling the system to just present the ones based on all posts which have the custom field for the event date…

    I am assuming that the second part might need to be merged into the first query otherwise I guess the correct 3 most upcoming event posts won’t show up… am I correct with this?

    How would this be done? Anyone able to just rewrite/organize the code correctly so I can copy and past it in and see if it works?

    Thanks in advance!

    Thread Starter binarybit

    (@binarybit)

    Thank you t31os_ for the information but although I have implemented your suggestion I am not not getting any results.

    Below please find the code being run. Please let me know if I have integrated this incorrectly. Also, I have tried it with the “global $wp_query;” under the $today = strtotime(date(“m/d/Y”)); which did not change the results.

    Any assistance is greatly appreciate!!!

    <?php
    	//Get the metadata for each child page
    	$today = strtotime(date("m/d/Y"));
    	$paged = get_query_var('paged') ? get_query_var('paged') : 1;
    	query_posts(array('meta_key'=>'event_start_date','orderby'=>'meta_value','cat'=>25,'order'=>'ASC','posts_per_page'=>3,'paged'=>$paged));
    	if (have_posts()) : while (have_posts()) : the_post(); ?>
    
        <?php  //Get all Events and run a check against current date
            $show_date =  strtotime(get_post_meta($post->ID, 'event_start_date', true));
            if($show_date >= $today) { ?>
    	<div id="homepage-events-list-container-group">
    		   <?php if(get_post_meta($post->ID, 'event_end_time', true) != ''){ ?>
                         <div id="homepage-events-list-container-left">
    			<div id="homepage-events-list-date"><?php echo get('event_start_date'); ?></div>
    			<div id="homepage-events-list-time"><?php echo get('event_start_time'); ?> - <?php echo get('event_end_time'); ?></div>
    			</div>
                       <?php } else { ?>
                         <div id="homepage-events-list-container-left">
    			<div id="homepage-events-list-date"><?php echo get('event_start_date'); ?></div>
    			<div id="homepage-events-list-time"><?php echo get('event_start_time'); ?></div>
    			</div>
                       <?php } ?>
               	<div id="homepage-events-list-container-right">
    		<div id="homepage-events-list-title"><a href="<?php the_permalink() ?>"><?php echo the_title(); ?></a></div>
    		<div id="homepage-events-list-excerpt">
    		<b><?php echo get('event_type'); ?></b> - <?php echo substr(get_the_excerpt(),0,115); echo '...  ' ?></div>
    		</div>
                </div>
        <?php } ?>
    
    <?php endwhile; endif; ?>
    Thread Starter binarybit

    (@binarybit)

    First of all, thank you very much for the information.

    I have made the applicable changes that you suggested but I am still getting the same exact results as before meaning I am NOT getting just the 3 posts showing up as desired.

    Any other help would be greatly appreciated!

    Here is my code right now:

    <?php
    	//Get the metadata for each child page
            $today = strtotime(date("m/d/Y"));
    	 global $wp_query;
            query_posts(array('meta_key'=>'event_start_date','orderby'=>'meta_value','cat'=>25,'order'=>'ASC','posts_per_page'=>-1),array('showposts'=>3));
    	 if (have_posts()) : while (have_posts()) : the_post(); ?>
    
        <?php  //Get all Events and run a check against current date
            $show_date =  strtotime(get_post_meta($post->ID, 'event_start_date', true));
            if($show_date >= $today) { ?>
    	<div id="homepage-events-list-container-group">
    		   <?php if(get_post_meta($post->ID, 'event_end_time', true) != ''){ ?>
                         <div id="homepage-events-list-container-left">
    			<div id="homepage-events-list-date"><?php echo get('event_start_date'); ?></div>
    			<div id="homepage-events-list-time"><?php echo get('event_start_time'); ?> - <?php echo get('event_end_time'); ?></div>
    			</div>
                       <?php } else { ?>
                         <div id="homepage-events-list-container-left">
    			<div id="homepage-events-list-date"><?php echo get('event_start_date'); ?></div>
    			<div id="homepage-events-list-time"><?php echo get('event_start_time'); ?></div>
    			</div>
                       <?php } ?>
               	<div id="homepage-events-list-container-right">
    		<div id="homepage-events-list-title"><a href="<?php the_permalink() ?>"><?php echo the_title(); ?></a></div>
    		<div id="homepage-events-list-excerpt">
    		<b><?php echo get('event_type'); ?></b> - <?php echo substr(get_the_excerpt(),0,115); echo '...  ' ?></div>
    		</div>
                </div>
        <?php } ?>
    
    <?php endwhile; endif; ?>
Viewing 10 replies - 1 through 10 (of 10 total)