Title: linusj's Replies | WordPress.org

---

# linusj

  [  ](https://wordpress.org/support/users/linusj/)

 *   [Profile](https://wordpress.org/support/users/linusj/)
 *   [Topics Started](https://wordpress.org/support/users/linusj/topics/)
 *   [Replies Created](https://wordpress.org/support/users/linusj/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/linusj/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/linusj/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/linusj/engagements/)
 *   [Favorites](https://wordpress.org/support/users/linusj/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: TDO Mini Forms] Title of post](https://wordpress.org/support/topic/plugin-tdo-mini-forms-title-of-post/)
 *  [linusj](https://wordpress.org/support/users/linusj/)
 * (@linusj)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/plugin-tdo-mini-forms-title-of-post/#post-1266015)
 * Read this link ->
    [http://thedeadone.net/forum/?p=418#comment-1542](http://thedeadone.net/forum/?p=418#comment-1542)
 * > <?php
   >  /* assuming you have called the custom field key “name”… */
   > $post_title = get_post_meta($post_id, ‘name’, true);
   > $postdata = array(
   >  “ID” => $post_id, “post_title” => $post_title; sanitize_post(
   > $postdata,”db”); wp_update_post($postdata); ?>
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Linking categories to pages](https://wordpress.org/support/topic/linking-categories-to-pages/)
 *  [linusj](https://wordpress.org/support/users/linusj/)
 * (@linusj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/linking-categories-to-pages/#post-1132566)
 * you would use templates for individual pages in 2.8.
 * if you create a “mypagetemplate.php” file in your theme folder and place at the
   very top of this file – this code:
 *     ```
       <?php
       /*
       Template Name: mypagetemplate.php
       */
       ?>
       ```
   
 * wordpress automatically interprets it as a template file that you can assign 
   to individual pages.
 * (tip: copy paste the index file code into your template, just to have something
   to work with…)
 * This page may then be filtered for different categories by using either query_posts
   calls or in_category calls in the template file.
    read the help files for each
   function.
 * it is all very clear as sausage water 😉
 * *edit: There is a strong reason to use query_posts instead of in_category, because‘
   the loop’ still counts up using the in_category call, and if you have 10 non 
   category in a row, your page won’t display anything, while the query_post will
   display a clean 10 post regardless, (if that is your setting) everytime and anytime…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Querying posts Next Posts Link in Index](https://wordpress.org/support/topic/querying-posts-next-link-article-in-index/)
 *  [linusj](https://wordpress.org/support/users/linusj/)
 * (@linusj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/querying-posts-next-link-article-in-index/#post-1099698)
 * sorry about that!
    lost the category filtering due to a typo in the code above…
 * this:
    `$querystring = 'cat='. $submissions.','.$inspiration.','.$finalist.','.
   $offset;`
 * should be this:
    `$querystring = 'cat='. $submissions.','.$inspiration.','.$finalist.
   $offset;`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Querying posts Next Posts Link in Index](https://wordpress.org/support/topic/querying-posts-next-link-article-in-index/)
 *  [linusj](https://wordpress.org/support/users/linusj/)
 * (@linusj)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/querying-posts-next-link-article-in-index/#post-1099697)
 * I was filtering posts on a single page with the function call ‘query_posts’ and
   noticed after a while the same problem as the original poster (Dunkkan) – the
   unabillity to sift through older and newer posts with the next_posts_link or 
   previous_posts_link call, and it was easily addressed to the query_post function,
   since if I turned it off, everything worked fine.
 * this seems to solve it. I’m not sure for how long though, since I’m quite novice
   to php and wordpress altogether. I make of use of the get_query_var and dynamically
   add the appropriate paged number to the offset variable.
 *     ```
       <?php
           //get the categories...
           $submissions = get_cat_ID( 'submissions' );
           $inspiration = get_cat_ID( 'inspiration' );
           $finalist = get_cat_ID( 'finalist' );
           $crew = get_cat_ID( 'crew' );
   
       	if(intval(get_query_var('paged'))>1){
       		$offset = '&offset='.((get_query_var('paged')-1)*10);
       	}else{
       		$offset = '&offset=0';
       	}
   
       	$querystring = 'cat='. $submissions.','.$inspiration.','.$finalist.','.$offset;
       	?>
   
           <!--begin query-->
           <?php query_posts($querystring.'&showposts=10'); ?>
   
       	<?php if (have_posts()) : ?>...
   
       ...<?php endif; ?>
   
           <!--end query-->
           <?php wp_reset_query(); ?>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)