fallenmedia
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Integration into non-wordpress site – PermalinksI am pretty sure the issue lies here:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>What do I have to change to show posts with postname permalinks?
Forum: Fixing WordPress
In reply to: Domain Addon QuestionThank you@!
Forum: Fixing WordPress
In reply to: Domain Addon QuestionDoes anybody know what I’m talking about? Am I over thinking this?
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteHow do you enter line breaks?
Because right now spaced out like this:
This is a comment
Comment posted byAuthor1This is a comment
Comment posted byAuthor2This is another comment
Comment posted byAuthor
Other than that it works perfectly
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteHey,
The above code gives me this error:
Parse error: syntax error, unexpected T_ECHO, expecting ‘,’ or ‘;’ in /home/manbartz/public_html/blog.php on line 106Line 106 –
echo '<p>Comment posted by</p>Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 site<?php /* Short and sweet */ define('WP_USE_THEMES', false); require('blog/wp-blog-header.php'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- Test if the current post is in category 3. --> <!-- If it is, the div box is given the CSS class "post-cat-three". --> <!-- Otherwise, the div box is given the CSS class "post". --> <?php if ( in_category('3') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?> <!-- Display the Title as a link to the Post's permalink. --> <h2 style="font-size: 20px;"><?php the_title(); ?></h2> <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <!-- Display the Post's content in a div box. --> <div class="entry"> <?php the_content(); ?> </div> <!-- Display a comma separated list of the Post's Categories. --> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <!-- closes the first div box --> <!-- Comment below --> <h3><?php $comments = get_comments('post_id=15'); foreach($comments as $comment) : echo($comment->comment_content); endforeach; ?></h3> <p>Comment posted by <?php $comments = get_comments('post_id=15'); foreach($comments as $comment) : echo($comment->comment_author); endforeach; ?> </p> <!-- Stop The Loop (but note the "else:" - see next line). --> <?php endwhile; else: ?> <!-- The very first "if" tested to see if there were any Posts to --> <!-- display. This "else" part tells what do if there weren't any. --> <p>Sorry, no posts matched your criteria.</p> <!-- REALLY stop The Loop. --> <?php endif; ?>Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteNow it’s showing the author name 3 times… I cant link you to anything right now, but using that exact comment_author snippet above from the get_comments wpcodex page results in this for some reason:
Comment 1Comment 2Comment 3
Comment posted by AndrewAndrewAndrewIt is displaying multiple comments on one line too, I just noticed this.
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteSweet, if I could buy you a beer I would.
For the comment_author snippet, why is it posting the author name twice?
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteThanks Graphical,
I inserted that code, and tested a comment with it. It only displays the comment author.
I’m pretty new with PHP.
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteLet me know if you want the surrounding html
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 site<?php /* Short and sweet */ define('WP_USE_THEMES', false); require('blog/wp-blog-header.php'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- Test if the current post is in category 3. --> <!-- If it is, the div box is given the CSS class "post-cat-three". --> <!-- Otherwise, the div box is given the CSS class "post". --> <?php if ( in_category('3') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?> <!-- Display the Title as a link to the Post's permalink. --> <h2 style="font-size: 20px;"><?php the_title(); ?></h2> <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <!-- Display the Post's content in a div box. --> <div class="entry"> <?php the_content(); ?> </div> <!-- Display a comma separated list of the Post's Categories. --> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <!-- closes the first div box --> <!-- Stop The Loop (but note the "else:" - see next line). --> <?php endwhile; else: ?> <!-- The very first "if" tested to see if there were any Posts to --> <!-- display. This "else" part tells what do if there weren't any. --> <p>Sorry, no posts matched your criteria.</p> <!-- REALLY stop The Loop. --> <?php endif; ?>Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteForum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteForum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteProbably misunderstanding you, but I have successfully used the above code to display my blog posts on my existing website… I just want to display comments… really, no way?
Forum: Fixing WordPress
In reply to: Help with integration into existing HTML5 siteIf you are using WordPress stuff, the pages will be WordPress. Meaning you can’t use pieces of it like the loop, in the way that you want. You can’t call the loop and have it display on your non WordPress site. It will have to be a theme.
Thanks for your reply.
What if I created a testimonials category, and displayed the comments on my non-wp site.
<?php if ( in_category('3') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?>Is there php code where I can have it display comments from a specific category?