Commit d923cdca authored by O'Reilly Media, Inc's avatar O'Reilly Media, Inc

Initial commit

parents
## Example files for the title:
# WordPress: The Missing Manual, by Matthew MacDonald
[![WordPress: The Missing Manual, by Matthew MacDonald](http://akamaicovers.oreilly.com/images/9781449309848/cat.gif)](https://www.safaribooksonline.com/library/view/title/9781449359867//)
The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website.
O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN.
If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at <permissions@oreilly.com>.
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.
<?php
add_filter( 'widget_text', array( $wp_embed, 'run_shortcode' ), 8);
add_filter( 'widget_text', array( $wp_embed, 'autoembed'), 8 );
?>
\ No newline at end of file
<?php
global $post;
$args = array( [ Your search and sort criteria go here. ] );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :
setup_postdata($post); ?>
[ This is where you display the post data you want. ]
<?php endforeach; ?>
\ No newline at end of file
logo.png

3.46 KB

<?php get_header(); ?>
<div id="content" class="clearfix">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="archive-title"><?php
printf( __( 'Our Products: %s', 'pinblack' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>
<?php
$category_description = category_description();
if ( ! empty( $category_description ) )
echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
?>
</header>
<div id="boxes">
<div id="loading"></div>
<?php /* Start the Loop */ ?>
<?php $posts = query_posts( $query_string . '&orderby=title&order=asc' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="item" >
<header>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php if(the_title( '', '', false ) !='') the_title(); else _e( 'View Post', 'pinblack' ); ?></a></h2>
</header>
<section class="post_content">
<div class="thumb">
<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo the_post_thumbnail( 'medium' ); ?></a>
<?php else : ?>
<?php $postimgs =& get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
if ( !empty($postimgs) ) :
$firstimg = array_shift( $postimgs );
$my_image = wp_get_attachment_image( $firstimg->ID, 'medium' );
?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo $my_image; ?></a>
<?php else : ?>
<img src="<?php echo get_template_directory_uri(); ?>/library/images/noimage.png" /><?php endif; ?>
<?php endif; ?>
</div>
</section> <!-- end article section -->
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div id="WarrantyBox">
We stand behind our products. All our <?php single_cat_title(); ?> are protected by the best <a
href="http://prosetech.com/wordpress/distinctfurnishings/warranty/">warranty</a> in the business.
</div>
</div> <!-- end #content -->
<?php if (function_exists("pinblack_pagination")) {
pinblack_pagination();
} elseif (function_exists("pinblack_content_nav")) {
pinblack_content_nav( 'nav-below' );
}?>
<?php get_footer(); ?>
\ No newline at end of file
<?php get_header(); ?>
<div id="content" class="clearfix">
<div id="WelcomePageMain">
<h1 class="archive-title">Welcome, lover of fine furniture.</h1>
<p>Passionate about style and grace? Looking for furnishings that fit your life as well as they fit your
room? You've come to the right place. <b>Distinctive Furnishings</b> offers the best in fine furniture,
for simply any budget.</p>
<div class="col">
<h2>Luxurious Sofas</h2>
<ul>
<?php
global $post;
$args = array( 'category' => 4, 'order' => 'asc', 'orderby' => 'title' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<div class="col">
<h2>Fine Tables</h2>
<ul>
<?php
global $post;
$args = array( 'category' => 5, 'order' => 'asc', 'orderby' => 'title' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<div class="col">
<h2>Award-Winning Chairs</h2>
<?php
global $post;
$args = array( 'category' => 3, 'order' => 'asc', 'orderby' => 'title' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
<?php endforeach; ?>
</div>
</div>
</div> <!-- end #content -->
<?php if (function_exists("pinblack_pagination")) {
pinblack_pagination();
} elseif (function_exists("pinblack_content_nav")) {
pinblack_content_nav( 'nav-below' );
}?>
<?php get_footer(); ?>
\ No newline at end of file
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content post_content">
<?php the_content(); ?>
<?php
echo do_shortcode('[show_wp_shopping_cart]');
?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'pinblack' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
\ No newline at end of file
<?php
$post = $wp_query->post;
if (in_category('news')) {
include(TEMPLATEPATH.'/single-news.php');
}
elseif (in_category('suppliers')) {
include(TEMPLATEPATH.'/single-suppliers.php');
}
elseif (in_category('people')) {
include(TEMPLATEPATH.'/single-people.php');
}
else {
include(TEMPLATEPATH.'/single-product.php');
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment