Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Harmeet Gabha

    (@scorpion380)

    Thanks Chinmoy. The only difference I see is
    ‘orderby’ => ‘menuorder’,
    changed to
    ‘orderby’ => ‘menu_order’,

    This doesn’t make any difference. I can even remove the orderby parameter which has the same result.

    Harmeet Gabha

    (@scorpion380)

    I am having the same problem but your suggested solution is not working for my custom post types.

    What am I doing wrong?

    <?php
    /*
    Template Name: Wallpaper
    
     * @author Harmeet Gabha
     * @copyright 2010
     */
    
    ?>
    <?php get_header(); ?>
    	<div id="content">
    	<?php
    		$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		echo "paged " . $paged;
    		$loop = new WP_Query(array('post_type' => 'wallpaper',
    									'post_status' => 'published',
    									'paged' => $paged,
    									'posts_per_page' => 8,
    									'orderby' => 'menuorder',
    									'caller_get_posts' => 1
    									));
    	?>
    	<div id="wallpaper-container">
    	<ul class="blog-wallpaper">
    	<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    	<?php
    		//$custom = get_post_custom($post->ID);
    		//$screenshot_url = $custom["screenshot_url"][0];
    		//$website_url = $custom["website_url"][0];
    	?>
    
    	<?php ob_start();the_post_thumbnail();$toparse=ob_get_contents();ob_end_clean();?>
    	<? preg_match_all('/src=("[^"]*")/i', $toparse, $img_src); $thumbnail = str_replace("\"", "", $img_src[1][0]);?>
    
    			<li id="blog-<?php the_ID(); ?>">
    			<em><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    
    			</em>
    			<a href="<?php the_permalink() ?>">
    			<img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumbnail; ?>&w=200&h=150&zc=1" alt="image" />
    			</a>
    			</li>
            <?php endwhile; ?>
    		</ul>
    	</div>
    
    <div class="navigation">
      <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
      <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
      </div>
    
        </div><!-- #content -->
    	<?php get_sidebar();?>
    <?php get_footer(); ?>

    Harmeet Gabha

    (@scorpion380)

    I read somewhere that you can upload the file using image uploader or mediae uploader built into the post. However, I am looking to know how I can then display a drop down box in my custom post using custom fields which lists all the attachments for each post.

    good luck

    Thread Starter Harmeet Gabha

    (@scorpion380)

    FYI.

    To get around this problem I used AJAX to get FEED data from my each site and display it on the page. This way I can call various feeds and display their data on my site.

    Hopefully the next version of WordPress will have this basic capability of calling it’s functions from external php pages. LOL!

    Resolved.

    I am having the same trouble. I can call the functions from external file and that works. The problem I have is I run three blogs and want to get latest posts from each blog and display them on a landing page.

    Check out this post.

    Thread Starter Harmeet Gabha

    (@scorpion380)

    Is there anybody out there who can help me with this?

    Thread Starter Harmeet Gabha

    (@scorpion380)

    Ok. I started creating a class for what I wanted to do but now I am getting this strange error. Any ideas would be appreciated.

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/username/public_html/harmeet/photography/wp-settings.php on line 268

    Here is my code. The idea is to create a class and use multiple Objects to initialise. This way using multiple objects I am able to call multiple wp-blog-header.php files and call the necessary functions to do what I want.

    I’ve also tried the Full path eg. /home/…./wp-blog-header.php and I get the same error. So I don’t believe its due to this reason.

    <?php
    
    class BlogRoll {
    	public $wp_header_loc;
    
    	public function __construct($wp_header_loc = '/wordpress/wp-blog-header.php'){
    		$this->wp_header_loc = $wp_header_loc;
    
    	}
    	public function GetPostCount(){
    		include $this->wp_header_loc;
    		if ($this->wp_header_loc != "")
    		{
    			$count_posts = wp_count_posts();
    			echo $count_posts->publish;
    		}
    
    	}
    
    	/*public function GetPostList(){
    		include($this->wp_header_loc);
    		if($this->wp_header_loc !="")
    		{
    			$data = array();
    			$i=0;
    			query_posts('showposts=5');
    			while (have_posts()) : the_post();
    				//$data($i) = array('Link'=>the_permalink(),
    				//					'Title'=>the_title());
    			endwhile;
    			return $data;
    		}
    		else
    		{
    			return NULL;
    		}
    	}*/
    }
    
    $FirstBlog = new BlogRoll('photography/wp-blog-header.php');
    // Tried the Full path eg. /home/.... same error.
    //$FirstBlog->wp_header_loc = "/home/username/public_html/harmeet/tech/wp-blog-header.php";
    echo $FirstBlog->wp_header_loc;
    echo $FirstBlog->GetPostCount();
    
    $SecondBlog = new BlogRoll('design/wp-blog-header.php');
    //$SecondBlog->wp_header_loc = "/home/username/public_html/harmeet/design/wp-blog-header.php";
    echo "SecondBlog" . $SecondBlog->GetPostCount();
    ?>
    Thread Starter Harmeet Gabha

    (@scorpion380)

    No problem. I think I can write my own function class to call each blog separately and the return back to my page. Once I get it working I will share the code and post a link.

    Cheers
    Harmeet

    Thread Starter Harmeet Gabha

    (@scorpion380)

    MichaelH,

    Another question: Is there a trick to querying 3 different wordpress blogs from the same page?

    I have three blogs so need to call three different wp-blog-header.php files. I am doing this in a sequential fashion but the code output results from the first wp-blog-header.php for all three instances.

    Have a look at http://harmeet.gabha.net/indextwo.php. You will see what I mean.

    <div id="heading">My latest <span class="blog">Blogs</span></div>
    	<div id="message">
    	<div id="blogs">
    	<?php require('/home/username/public_html/folder/design/wp-blog-header.php'); ?>
    	<?php
    		$count_posts = wp_count_posts();
    		$published_posts= $count_posts->publish;
    	?>
    	<span>Design Blog<br /><span>(<?php echo $published_posts; ?> posts in 
    
    total)</span></span>
    	<ul>
    	<?php query_posts('showposts=5'); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
    	<?php endwhile;?>
    	</ul>
    	</div>
    
    	<div id="blogs">
    	<?php require('/home/username/public_html/folder/photography/wp-blog-header.php'); ?>
    	<?php
    		$count_posts = wp_count_posts();
    		$published_posts= $count_posts->publish;
    	?>
    	<span>Photography Blog<br /><span>(<?php echo $published_posts; ?> posts in 
    
    total)</span></span>
    	<ul>
    	<?php query_posts('showposts=5'); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
    	<?php endwhile;?>
    	</ul>
    	</div>
    
    	<div id="blogs">
    	<?php require('/home/username/public_html/folder/tech/wp-blog-header.php'); ?>
    	<?php
    		$count_posts = wp_count_posts();
    		$published_posts= $count_posts->publish;
    	?>
    	<span>Tech Blog<br /><span>(<?php echo $published_posts; ?> posts in total)
    
    </span></span>
    	<ul>
    	<?php query_posts('showposts=5'); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
    	<?php endwhile;?>
    	</ul>
    	</div>
    
    	</div>

    Thanks in advance.

    Thread Starter Harmeet Gabha

    (@scorpion380)

    Thanks MichaelH. That’s exactly what I wanted to know. The first link is what I needed.

    Thread Starter Harmeet Gabha

    (@scorpion380)

    Thanks. I just noticed my link didn’t get added to the post. I actually want to know how this site below would have done this. Please checkout the link.
    Tutorial 9 Site

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