drphil9001
Forum Replies Created
-
Forum: Installing WordPress
In reply to: Contents of wp-contentThat was what I thought was happening, just wanted some confirmation.
Thanks.
Forum: Installing WordPress
In reply to: Contents of wp-contentThere are a bunch of kubrick*.jpg files, and a bunch that look like they are from a theme and perhaps a plug-in thrown in. Like 404.php, akismet.php, comments.php, header.php, hello.php, functions.php, footer.php, etc. That is not all of them, not in any order.
Forum: Fixing WordPress
In reply to: Display certain posts by ID on a new pageOff the top of my head a quick way to do this may be to have a special category for “bestposts” and then you should be able to get to the page via some like:
my.site/?cat=5
if the ID happens to be 5.
Forum: Fixing WordPress
In reply to: How do I limit blog posts to 1 pageIt depends on the theme that you are using, but a good place to start would be the Main Index Template. This is the one that would get used unless there are other files in the theme that would supersede it.
See Template Hierarchy for more information.
Forum: Fixing WordPress
In reply to: How do I limit blog posts to 1 pageIs something like this what you are looking for?
Put the following on your PHP file prior to The Loop:
$query_string .= "&paged=1&posts_per_page=1"; $query_posts( $query_string );
Which will only retrieve the latest post. Then just remove the navigation link and you will get one post on the page. Check out query_posts for more information.
Forum: Plugins
In reply to: Comparing 2 FunctionsI believe that you want get_the_author() instead of the_author(). If you look at author_template.php you will see that the later echos the result of the former.
Forum: Fixing WordPress
In reply to: Conditional tags on 2.3 when using a static home pageI have the same problem as well and here is how I got around what I think is a bug. (See thread.)
I have a WP Page called Blog and a corresponding template Blog.php with a template name of TmplBlog. Be sure that the template name is different from the name of the page or other weirdness (bugs?) will crop up with navigation links.
I created the following conditional functions in my functions.php file:
function get_page_id($page_title, $output = OBJECT) { global $wpdb; $page_title = $wpdb->escape($page_title); $page = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$page_title' AND post_type='page'"); if ( $page ) return $page; return NULL; } function is_blog() { global $wp_query; global $cached_page_id; $blog_page_id = get_page_id('Blog'); if ( is_category() || is_day() || is_month() || is_year() || is_paged() || is_single() ) return true; if ( isset($cached_page_id) && ($blog_page_id == $cached_page_id )) return true; if ( is_page('Blog') ) return true; return false; }
I then make sure that in any logic a call to is_blog() happens prior to any is_home calls. Note that the cached_page_id business is there since the page_id seems to be reset when I run custom queries on the page. So I cache it first thing on my TmplBlog tempalte.
Forum: Fixing WordPress
In reply to: Adding actual pages, different from the main theme?Search the forums. There have been many threads that discuss topics like this. (here, here, and here)
Basically, you will have to modify the theme to accomplish what you are trying to do.
Check this topic out for an idea to show or hide the sidebar on certain pages. You will need to use is_page() instead of is_home and wrap the get_sidebar() call.
Forum: Fixing WordPress
In reply to: Get page id when using permalinksThanks, but that doesn’t seem to work in my situation.
$cached_page_id = $wp_query->get('page_id'); echo "get(page_id) = " .$cached_page_id . "<br/>; $cached_page_id = $wp_query->get_queried_object_id();
results in:
get(page_id) = 0
get_queried_object_id() = 16Forum: Fixing WordPress
In reply to: News Script On Two PagesFrom poking around it seems that there are multiple ways of doing this. My suggestion is but one.
You might also want to check out Installing Multiple Blogs for other ideas.
Forum: Fixing WordPress
In reply to: Get page id when using permalinksOf course, immediately after hitting the Send Post button I thought of the solution.
global $wp_query; $cached_page_id = $wp_query->get_queried_object_id();
sorry for the spam
Forum: Fixing WordPress
In reply to: Is there anyway to only show one category on Home?Check out query_posts() and the conditional tags. You can test which page you are on in index.php and specify the category to the query_posts differently depending on which page you are on.
Forum: Fixing WordPress
In reply to: News Script On Two PagesI think that you would basically have to create/edit the theme you are using to accomplish this. I am doing the something similar on my comapany website that I just ported to WordPress.
I have a couple of special blog categories that only show up on certain pages and then a blog page that show all the other post categories. The best way that I found to do this is to use query_posts() along with the various conditional tags to set the categories to use in the queries.
I also use this technique to control the sidebar to show the various “special” category posts on different pages.
Forum: Themes and Templates
In reply to: Conditional Tag that Recognizes Page Template TypeWhat are you trying to accomplish?
I use one template for many pages. At the beginning of the template I use the is_page(‘foo’) or is_page(‘bar’) to determine which page is loading it and go from there.
Forum: Themes and Templates
In reply to: Parent Category PagesI was hoping that I would not have to have a category page for each category that is a child. So lets say that I have a parent category (pCat) and three children (cCat1, cCat2, cCat3). I was wondering if there is a way to have a single pCat.php page that would be used to render all of them?