Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional WordPress: Design and Development, 3rd Edition
This is the forum to discuss the Wrox book Professional WordPress: Design and Development, 3rd Edition by Brad Williams, David Damstra, Hal Stern; ISBN: 978-1-118-98724-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional WordPress: Design and Development, 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 11th, 2016, 05:10 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default slider custom post examples

Hi,
I followed the example in the book for creating a custom slider and had some issues with custom post types registering which resulted in a
Fatal error: Call to a member function have_posts() on null
using this piece of code:

Code:
<?php 
	$args = array(
			    'posts_per_page' => '-1',
			    'post_type' => 'slides',
					);
	$mySlides = new WP_Query( $args );
				
	while ( $myslides -> have_posts() ) : $myslides -> the_post();
				?>
	<a href="<?php the_permalink(); ?>"><?php the_title(); ?>slides</a><br />
	<?php endwhile;
				
				//reset postdata
				wp_reset_postdata();
				?>
What does the error mean exactly?
I've set up a custom post type as the book states?
I've relinquished using global variables?

Any tips pointers?


Similar Threads
Thread Thread Starter Forum Replies Last Post
WOW slider with aspnet page dksellou ASP.NET 4.5.1 General Discussion 1 April 28th, 2015 03:51 PM
Slider alignment justinneng BOOK: Beginning HTML, XHTML, CSS, and JavaScript 0 January 21st, 2012 01:22 PM
Need a vertical image slider arnabghosh ASP.NET 2.0 Professional 0 December 21st, 2009 10:45 AM
First Post! adding an icon to a custom user form Banquo_ws Excel VBA 2 March 6th, 2007 04:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.