Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1443 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Development Software and Tools :

Is it just me, or does wordpress suck form a coding standpoint?

Thread title: Is it just me, or does wordpress suck form a coding standpoint?
Reply  
Page 2 of 2 < 1 2
    Thread tools Search this thread Display Modes  
12-07-2010, 08:23 PM
#11
Jordan is offline Jordan
Jordan's Avatar
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
 
Posts: 1,187
iTrader: 7 / 100%
 

Jordan is on a distinguished road

  Old

Yeah, I think you're just complaining about WordPress because you've just got an issue with not really knowing much about it.

Here is a query to grab the latest five posts. There are a bunch of other parameters that you can use with it as well.

Code:
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
  <li><a href="<?php the_permalink(); ?>">
       <?php the_title(); ?></a></li>
<?php endwhile; ?>
http://codex.wordpress.org/Function_...ce/query_posts

Refer to the codex for anything you don't know about. Or just PM me and I can help you out with finding what you would need to use.

12-07-2010, 08:34 PM
#12
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Originally Posted by Jordan View Post
Yeah, I think you're just complaining about WordPress because you've just got an issue with not really knowing much about it.

Here is a query to grab the latest five posts. There are a bunch of other parameters that you can use with it as well.

Code:
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
  <li><a href="<?php the_permalink(); ?>">
       <?php the_title(); ?></a></li>
<?php endwhile; ?>
http://codex.wordpress.org/Function_...ce/query_posts

Refer to the codex for anything you don't know about. Or just PM me and I can help you out with finding what you would need to use.
That's not the issue, I have the code I need and it works great inside my template. The issue is that I need to use that function outside of wordpress on a non-wordpress page. The function I need is located in wp-includes/post.php, which requires wp-includes/wp-db.php, which requires wp-includes/load.php, which requires wp-includes/functions.php, which requires wp-config.php, which for no apparent reason 302 redirects me to wp-admin/install.php

Here is the blog (see the "latest news article" section on the bottom):
http://67.227.152.40/~anaverag/dir/blog

Here is the hard coded part outside of the blog:
http://67.227.152.40/~anaverag/dir/index.php

Reply With Quote
12-07-2010, 08:44 PM
#13
Jordan is offline Jordan
Jordan's Avatar
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
 
Posts: 1,187
iTrader: 7 / 100%
 

Jordan is on a distinguished road

  Old

Well, if you need to use it in a non-WordPress blog, you're still doing it the wrong way. You can use the same query I use. You just add:

Code:
 <?php
require('/the/path/to/your/wp-blog-header.php');
?>
So now we have:
Code:
 <?php
require('/the/path/to/your/wp-blog-header.php');
?>
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
  <li><a href="<?php the_permalink(); ?>">
       <?php the_title(); ?></a></li>
<?php endwhile; ?>
Again, you can refer to the codex for using WordPress outside of.. WordPress: http://codex.wordpress.org/Integrati...h_Your_Website

Thanked by 2 users:
Spherions (12-07-2010), Village Genius (12-07-2010)
12-07-2010, 08:59 PM
#14
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Thanks, that gets me a lot closer, but it still seems to be redirecting to wp-admin/install.php. I cant find an solution for this on Google or the docs so I'm wondering if you know what that is about.

I'd be willing to hire you to fix this.

Reply With Quote
12-07-2010, 09:19 PM
#15
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Just figured out what was happening:
Wordpress when included tried to get its files relitave to the location of the calling file. Since they were in different directories it could not find them. It then sent me to the install page because it figured I didnt install yet. Here is the fix

Code:
//Wrong
require('./blog/wp-blog-header.php');

//Wrong
require('blog/wp-blog-header.php');

//Right
define('ABSPATH', dirname(__FILE__).'/');
require(ABSPATH . 'blog/wp-blog-header.php');
edit: That actually broke something else, but it is yet another step to an actual solution. I'll post again when I find it.

edit2: The problem it created had to do with the inner workings of my templating system, I included the file in the same way in a non-template file and it all works perfect.

Thanks Jordan!

Reply With Quote
12-07-2010, 10:18 PM
#16
Jordan is offline Jordan
Jordan's Avatar
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
 
Posts: 1,187
iTrader: 7 / 100%
 

Jordan is on a distinguished road

  Old

Woo, glad you got it working!

It's okay on having the issues with WordPress. After sending you the query here, I remembered how in '08 I was clueless on how the **** I was going to include loop data on a non-WordPress blog. It's ridiculous how insanely easy it is once you know where to look.

But srsly, just PM me if you have questions or need help in the future. Don't mind one bit.

Reply With Quote
Reply  
Page 2 of 2 < 1 2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed