SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2013
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress into an existing PHP site

    Hi

    I’ve managed to integrate my blog into my website but I’m not sure if I’m doing it the cleanest way (I’ve picked it up from various blogs/ forums etc)

    I’d also like to use tags or categories to select which posts to show (like a WHERE clause in SQL would)

    IE: Only show posts with a tag (or category) of “YAL”

    My code below:

    PHP Code:
    <?php
    global $post;
    $args = array( 'posts_per_page' => 20 );
    $myposts get_posts$args );
    foreach( 
    $myposts as $post ) :    setup_postdata($post); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_content(); ?>

    <?php wp_get_attachment_image(); ?><?php get_tag(); ?><?php get_category(); ?> (these don’t actually work)

    </a><br />
    <?php endforeach; ?>
    Last edited by Force Flow; Jul 29, 2013 at 09:06. Reason: added code tags


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •