Forum Replies Created

Viewing 15 replies - 16 through 30 (of 60 total)
  • Thread Starter tsalagi

    (@tsalagi)

    Now that’s funny. I gotcha. Thanks for the clarification. I thought that name sounded familiar. Guess I should become more familiar with the people and not just the code.

    Thread Starter tsalagi

    (@tsalagi)

    Thanks for that line of attribution. That is what I think should have been in the introduction of the file wp-includes/widgets.php version 2.9 that I am using. That is my point. That line of attribution is not in that file. I’m not misinterpreting. It’s just a blanket statement in that file. I’m just saying it would be nice to have an attribution similar to what you put in your reply

    WordPress Widgets plugin referenced was actually a product of Automatic ( Matt Mullenweg )

    . For example it might read something like this if appropriate attribution was to be given to the contributors of WordPress.

    This functionality was found in a plugin(a product of the Automatic theme(by: Matt Mullenweg ) before WordPress 2.2 release which included it in the core from that point on.

    Now isn’t that better and more appropriate if one is to address the matter of attribution correctly? If members of the WordPress community build upon a work previously released by someone they generally give a line of attribution. I was just wondering why the WordPress Group didn’t/don’t follow the same practice.

    Karlotta. Have you found a fix for what it is that’s got you all fired up!
    I like that spark! Anyway, I’m not clear on what your talking about. I’ve used <?php $gtc = get_the_content; echo $gtc; ?> and I don’t see a p tag anywhere. Can you give specifics about how your using it? I’ll try to figure it out. I fix a lot of things without using plugins as I don’t like how unreliable they are either.
    Let me know if you still need help.

    I was looking for this type of thing through google. I don’t know why I didn’t come here first! Thanks for your updates on the sandbox. Did you do any documentation as far a the details of what you changed, added or removed? That would be a big help I think.

    Thanks again.

    Thread Starter tsalagi

    (@tsalagi)

    Michael. I read the short post in the link you provided. I didn’t see any reset used in either example. Here is an excellent post about this subject that some may find useful.
    Undocumented WordPress Query Function: wp_reset_query()
    I agree that using wp_reset_query is the most effecient way to get things done allowing the multiple use of query_posts. I’m assuming that is why the wp_reset_query was created in the first place.
    Changing the codex may clear up some of the confusion and misconceptions. query_posts. Removing

    Important note
    The query_posts function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page. If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead. Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.

    The query_posts function overrides and replaces the main query for the page. To save your sanity, do not use it for any other purpose.
    , and replacing it with correct usage and the requiring the inclusion of wp_reset_query.

    There still seems to be some confusion about the use of wp_reset_query with $WP_Query. Does every instance of query_posts and $WP_Query need to be reset? Should the reset be used at the beginning of every new custom loop? For the sake of clarity, I think these issues need to be addressed before adding specific usage instruction to the wp_reset_query page in the codex.

    Cheers

    Thread Starter tsalagi

    (@tsalagi)

    Thanks much Michael. Two things if you don’t mind. What does the caller_get_posts do? I can find little in the way of explanation in the codex.
    Also, I thought I knew how to add a specific author in that group of arguments
    'post_author' => author_number
    that doesn’t work as it does in `$wpdb’ but ‘author’ does. Why the inconsistency in WordPress?
    Thanks again.

    Thread Starter tsalagi

    (@tsalagi)

    Thanks. Here is the only loop on the page.

    <?php
    				$pub_posts = $wpdb->get_results("SELECT post_title, post_author, post_status, post_type, post_date FROM $wpdb->posts WHERE post_type = 'page' LIMIT 5");
    				foreach($pub_posts as $post) {
    					setup_postdata($post);
    			?>
    			<?php while ( have_posts() ) : the_post() ?>
    							<ul class="info_list">
    								<li><a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'Test Template'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a><li>
    								<li class="auth"><span class="author vcard"><a class="url fn n" href="<?php echo get_author_link( false, $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( __( 'View all articles by %s', 'Test Template' ), $authordata->display_name ); ?>"><?php the_author(); ?></a></span></li>
    								<li class="date"><span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span></li>
    								<li class="edit_link"><?php edit_post_link( __( 'Edit', 'template_test' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?></li>
    							</ul>
    				<?php endwhile; ?>
    			<?php } ?>

    Thread Starter tsalagi

    (@tsalagi)

    I’d like to hear all about that too. Thanks t31os_

    Thread Starter tsalagi

    (@tsalagi)

    t31os_ and MichaelH. I’m glad this conversation has kept going. As many times as I’ve seen the query_posts used for multiple loops and if one uses the wp_reset query method without any sinister result then I do believe that article in the Codex should be revised and revisited. I think using query_posts is the easiest way to setup a loop.

    Thread Starter tsalagi

    (@tsalagi)

    Thanks for direction Michael and RVoodoo. A new journey begins.

    Thread Starter tsalagi

    (@tsalagi)


    I just found this link before checking back here. Thanks.
    On this page it states.

    This function is used to get a list of all the posts that are defined in the blog. For the most part get_posts can be considered a mini version of query_posts, supporting nearly (but not all) optional parameters. Support parameters are listed below.

    I went to the query_post page which also has many parameters listed and usage examples. Can all of this be transfered into the wp_query?
    The wp_query page has a list of Methods and Properties but there is little in the way of usage examples. Seems strange if wp_query is the best method for multiple loops that there is not more extensive documentation about usage as there is with the other two loop methods.

    Thread Starter tsalagi

    (@tsalagi)

    Okay. One vote for Codex. Regarding your example. What are the objects you have populated your array with? I know that “post_type” is a field in the post table but what is ‘caller_get_posts’ and ‘posts_per_page’? Can you tell me where I can find an exhaustive list of these objects, so I can get back to work building a theme or application. I’m itching to get back to my theme but I hit a wall with the different types of loops and all the confusing info out there. So I feel like I’m back to square one I just want to get this right so when and if I release a theme it’s not all mucked up with bad code.
    Thanks

    Forum: Fixing WordPress
    In reply to: Custom Queries
    Thread Starter tsalagi

    (@tsalagi)

    Now I understand. Thanks esmi!

    Forum: Fixing WordPress
    In reply to: Custom Queries
    Thread Starter tsalagi

    (@tsalagi)

    Isn’t that redundant code then? I mean if the $wpdb->posts works then why include the wposts? I have an install with table prefix of projects, but using $wpdb->post works fine without $wpdb->post projectsposts. Maybe I’ve had no need to use aliases yet. Can you give me an example where they would absolutely need to be included?

    Thread Starter tsalagi

    (@tsalagi)

    I just slapped myself in the forhead. OUCH! I know it was simple. What a handy little gadget that function is.

    Thanks so much. Love the avatar!

Viewing 15 replies - 16 through 30 (of 60 total)