functionjunkie
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Bug in WordPress 1.5Oops… my bad… WP 1.5.2
Cheers,
Forum: Fixing WordPress
In reply to: is_home function – Same content, different pagesMichael,
Hmmm…. interesting… Here’s what I’ve got in my page.php:
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2 class="pagetitle"><?php if(is_home()) { echo 'pxLabs - Web and Interactive Agency'; } else { wp_title(''); echo' - Web and Interactive Agency'; } ?></h2>
<?php the_content(__('Read the rest of this page »')); ?>
<?php wp_link_pages(); ?>
<?php edit_post_link(__('Edit'), '', '
'); ?>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>Cheers,
Justin
Forum: Fixing WordPress
In reply to: is_home function – Same content, different pagesI tried using that code on index.php and home.php and it didn’t work.
It’s supposed to be used on page.php, but I cannot seem to get it to work properly.
Cheers!
Justin
Forum: Fixing WordPress
In reply to: Permalinks, Subpages and Custom File Names – Help NeededMoshu,
I am in the process of adding all the child-pages, but I’m curious to find out if adding .php to the end of the child page filename is possible, whether by .htaccess or some other means. ??
Cheers,
Justin
Forum: Fixing WordPress
In reply to: Permalinks, Subpages and Custom File Names – Help NeededMoshu,
Forgot to mention. Yes, this page would be created with WP.
Cheers,
Justin
Forum: Fixing WordPress
In reply to: Permalinks won’t work on local PCHuzzah! This solved my problem too. Thanks Viper!
Forum: Plugins
In reply to: Static Front Page – Am I Doing This Right?Nevermind folks I got it.
I’m using Ryan Boren’s Page To Front plugin, which solved the problem I was having.
Cheers,
Justin
Forum: Plugins
In reply to: Static Front Page – Am I Doing This Right?Bump?
Forum: Plugins
In reply to: Posts Per Page Plugin Spitting Back Blank Page After Upgrade to 1.5.1.2Thanks Kafka, that works like a charm.
Cheers,
– Justin
Forum: Fixing WordPress
In reply to: Monthly Archives Only Showing 5 at a TimeIan,
Coming back to this again… Just upgraded to WP 1.5.1.2, and that plugin is not working again… LOL
Checked the file for whitespace again, and it’s clean.
<?php
/*
Plugin Name: Custom Posts Per Page
Version: 1.0
Plugin URI: https://www.ads-software.com/support/6/11211
Description: Change the number of posts per page displayed for different page types.
Author: Based on code by rboren & brehaut
Author URI:
*/
$posts_per['home'] = 5;
$posts_per['day'] = 10;
$posts_per['month'] = 31;
$posts_per['search'] = 10;
$posts_per['year'] = 999;
$posts_per['author'] = 999;
$posts_per['category'] = 999;
function custom_posts_per_page($query_string) {
global $posts_per;
$query = new WP_Query();
$query->parse_query($query_string);
if ($query->is_home) {
if (preg_match("/posts_per_page=/", $query_string)) {
$query_string = preg_replace("/posts_per_page=[0-9]*/"
,"posts_per_page=$num_posts_on_home"
,$query_string);
} else {
if ($query_string != '') {
$query_string .= '&';
}
$query_string .= "posts_per_page=$num_posts_on_home";
}
}
} elseif ($query->is_day) {
$num = $posts_per['day'].'&order=ASC';
} elseif ($query->is_month) {
$num = $posts_per['month'].'&order=ASC';
} elseif ($query->is_year) {
$num = $posts_per['year'].'&order=ASC';
} elseif ($query->is_author) {
$num = $posts_per['author'];
} elseif ($query->is_category) {
$num = $posts_per['category'];
} elseif ($query->is_search) {
$num = $posts_per['search'];
}
if (isset($num)) {
if (preg_match("/posts_per_page=/", $query_string)) {
$query_string = preg_replace("/posts_per_page=[0-9]*/", "posts_per_page=$num", $query_string);
} else {
if ($query_string != '') {
$query_string .= '&';
}
$query_string .= "posts_per_page=$num";
}
}
return $query_string;
}
add_filter('query_string', 'custom_posts_per_page');
?>Are there any updates to this plugin? Or is WP not liking this plugin for other reasons?
Thanks,
Justin
Forum: Fixing WordPress
In reply to: Monthly Archives Only Showing 5 at a TimeViper007Bond: What if you had 100 posts that month though? You really want a page 10 miles long?
And it is displaying all posts for that month, but it’s doing it in a paged format.
I see your point… I don’t think I want a page 10 miles long… I certainly wouldn’t expect anyone to scroll that far either. LOL!!!
Anyways, thanks for the great plugin. Works like a charm!
Forum: Fixing WordPress
In reply to: Inserting Images in Posts – Bug?Great… Thanks guys! Much appreciated.
Forum: Fixing WordPress
In reply to: Inserting Images in Posts – Bug?Ah… good to know. I’m going to use the full path to the image. Thanks Jinsan.
Where can I get these 2 apps or plugins if need be?
– Justin
Forum: Fixing WordPress
In reply to: Monthly Archives Only Showing 5 at a TimeIan,
I figured out what it was…
I found this code snippet
' if ($query->is_home) {
if (preg_match("/posts_per_page=/", $query_string)) {
$query_string = preg_replace("/posts_per_page=[0-9]*/"
,"posts_per_page=$num_posts_on_home"
,$query_string);
} else {
if ($query_string != '') {
$query_string .= '&';
}
$query_string .= "posts_per_page=$num_posts_on_home";
}
}
'
in the perpage.php file, and replacing that with the original code solved the problem… Also, there was some whitespace in there as well, which probably didn’t help things either.
Either way, TextDrive didn’t like it very much, but it’s fixed now, and it works beautifully! Great work!
I’ll make sure that I blog about this plugin later today! ??
Justin
Forum: Fixing WordPress
In reply to: Monthly Archives Only Showing 5 at a TimeIan,
Hmmm, never thought of that actually. I will take a look and post back later.
Moshu: Thanks, I will check that out as well.
Cheers!
Justin