Michael Fields
Forum Replies Created
-
Forum: Installing WordPress
In reply to: How to open the PHP file????confi.php.php – This is not a WordPress file that I have ever seen???
as for opening the php file, I would right click on it and select “Properties” then under “Opens with”, select Notepad and then click “Apply” at the bottom of the dialog… this should make all php files open with Notepad from now on… use the same process for other files as well…
Forum: Everything else WordPress
In reply to: wordpress newbie questionsYour Questions:
1. Yes, WordPress is a great solution for your site 🙂2. In my experience with customizing WordPress, I have to admit that I would be absolutely lost without knowledge of php and mysql… I’ve been using WordPress since version 1.5 and it took me quite sometime to wrap my brain around it… I would suggest that you find a very knowledgeable WordPress developer/consultant in your local area to aid you in development.
3. I would use a theme which I would modify to suite the visual needs of the project. Please be aware that WordPress themes are much more than just templates. Themes supply all of the logic which determines which content to display on the front-end of the site. Modifying a theme can be a pain in the #@!@# though… especially when authors use the css global reset thingy (
*{margin:0;padding:0;}) and then have to write millions of lines of code to add margin and padding back to everything…. hmmm, I’m ranting now… sorry about that.Best of Luck,
-MikeForum: Themes and Templates
In reply to: Choosing Default ThumbnailI answered a similar question here. The user seems to be using one of those “magazine themes” which lets you supply an image for the homepage via custom fields.
There is an easier way of doing this though. Please see this thread.
As far as a different default image for each category, something like this would probably work (inside the loop):
<?php $custom_field_key = 'thumbnail_url'; $default_url = 'http://example.com/default-image.jpg'; $category_thumb_urls = array( 3 => 'http://example.com/image-1.jpg', 4 => 'http://example.com/image-2.jpg', 5 => 'http://example.com/image-3.jpg' ); $url = get_post_meta( $post->ID, $custom_field_key, true ); if( !empty( $url ) && ( list( $w, $h ) = getimagesize( $url ) ) ) { $thumbnail = $url; } elseif( in_category( array_keys( $category_thumb_urls ) ) ) { foreach( $category_thumb_urls as $k => $v ) { if( in_category( $k ) ) { if( list( $w, $h ) = getimagesize( $v ) ) $thumbnail = $v; } } } elseif( list( $w, $h ) = getimagesize( $default_url ) ) $thumbnail = $default_url; else $thumbnail = false; if ( $thumbnail ) print '<img src="' . $thumbnail . '" width="' . $w . '" height="' . $h . '" alt="" />'; ?>you’ll want to change the values for the first 3 variables to match how your blog is set up. The array consists of category id for keys and thumbnail path as values. You shouldn’t need to edit anything below this.
Hope this helps,
-MikeForum: Fixing WordPress
In reply to: How to edit the original gallery-feature of WP?@stereopoly,
I would suggest that you base you image.php file on the default theme’s image.php… there are special template tags that are not used in page.php. Some of which are:wp_get_attachment_url() previous_image_link() next_image_link()Also, see this plugin if you do not like how WordPress uses images for it’s previous and next navigation:
http://mfields.org/wordpress-plugins/text-based-image-links/
Forum: Themes and Templates
In reply to: How to show parent-gallery on image.phpHow does 2 lines of code sound?
$gallery_shortcode = '[gallery id="' . intval( $post->post_parent ); . '"]'; print apply_filters( 'the_content', $gallery_shortcode );Forum: Fixing WordPress
In reply to: get_post_meta helpPretty easy fix, just add a bit of logic:
<div class="entry"> <?php $screen = get_post_meta($post->ID,'screen', true); $screen = ( !empty( $screen ) ) ? $screen : 'path/to/default-image.jpg'; print '<img src="' . $screen . '" width="160" height="100" alt="" />'; the_content_limit(600, ""); ?> <div class="clear"></div> </div>Please let me know if you have trouble with this code – it works in theory, but was not tested.
Forum: Fixing WordPress
In reply to: updating h1, h2 etc in custom.cssin custom css you will find style information for h1 at the bottom of the file, change it to:
h1{ font-size: 2em; color: #000000; padding-bottom: 10px; margin: 0px; }Forum: Themes and Templates
In reply to: Shortcodes don’t work in excerpts?anywhere should work
Forum: Plugins
In reply to: dynamic php text always displays before other textOne thing is for certain… your code is a little messed up:
<?php if (is_single()) wp_title('-',true,'right').$category_name; else bloginfo('name'); ?>try:
<?php if( is_single() ) { print wp_title( '-', false, 'right') . ' ' . $category_name; else bloginfo('name'); ?>Forum: Plugins
In reply to: wp_query() specific posts with post__inNot as far as I know. If needed ths content, I would use a custom query like this:
$spotlight = $wpdb->get_results( "SELECT post_content FROM $wpdb->posts WHERE ID IN( 31,41 )" ); if ( $spotlight ) { foreach( $spotlight as $spot ) { print apply_filters( 'the_content', $spot->post_content ); } }Note, you will want to keep the query as simple as possible to try to ensure that there are no problems when you upgrade. he query above will pose little problems do to the act that it references on the “post_content” column of the “post” table -> both of which have been a part of WordPress for a long time.
Best of luck,
-MikeForum: Plugins
In reply to: wp_query() specific posts with post__indo this before your normal loop:
$include = array( 37, 1 ); query_posts( array( 'post__in'=>$include ) );Forum: Fixing WordPress
In reply to: How to use ELSEIF in the sidebarMaybe try one of these functions instead of
is_page('home'):
http://codex.ww.wp.xz.cn/Function_Reference/is_home
http://codex.ww.wp.xz.cn/Function_Reference/is_front_pageForum: Plugins
In reply to: Thumbnail for home page & regular size image for permalink pageCode should be placed in the loop any loop really – index.php, category.php, archives.php, etc
Forum: Fixing WordPress
In reply to: How to use ELSEIF in the sidebartry something like this:
<?php if ( is_page('home')) : ?> <li> <h3></h3> <iframe> </li> <?php elseif ( is_page('2')) : ?> <li> <div class="cloud"> </li> <?php else : ?> <li> <h3></h3> <iframe> </li> <?php endif; ?>Forum: Fixing WordPress
In reply to: Javascript inside post, need help!Please see this thread:
http://ww.wp.xz.cn/support/topic/147154?replies=4Although you can enable javascript in your post content, it is not very secure to so.