Michael Fields
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: moving blog and image galleryYou will need to export your current blog and import it into a new blog. You can find these pages in you Admin section under “Tools”.
This has to do with a problem in the wordpress forums and how it displays ampersands. I post ted the same code in the pasebin, please follow this link:
Forum: Fixing WordPress
In reply to: Help! Database/500 Error!Looks like it’s working fine to me…
Forum: Fixing WordPress
In reply to: After LOGIN, DO NOT want to be taken to teh DASHBOARDSteve, it will do exactly what you asked for… after a user has loged into your site, they will be redirected to the front page of your WordPress installation. You can edit the function to send them where ever you want, just change this line:
Your blog’s Front Page:
return get_bloginfo( 'url' );or, A url of your choice:
return 'http://example.com/';Forum: Themes and Templates
In reply to: What theme does ww.wp.xz.cn use?I’m pretty sure that ww.wp.xz.cn uses a custom theme based off of the 2.5 Administration Panels. But someone has released a “Premium” theme that closely resembles it. You can find it here:
Forum: Themes and Templates
In reply to: Suspicious code in free theme?No Problem, Which theme is it BTW?
Forum: Plugins
In reply to: dynamic php text always displays before other textYou have to be aware that many WordPress Template Tags will print/echo the value you want. If you put these tags inside a print/echo string – php will get confused and mess up the order. Basically, you need to make two statements. Please see the following code. I would strongly suggest using curly braces.
<div class="main_page_tag"> <?php if ( is_home() ) { bloginfo('description'); } elseif ( is_month() ) { echo "Posts for "; the_time('F, Y'); } else { bloginfo('description'); } ?> </div>Forum: Fixing WordPress
In reply to: After LOGIN, DO NOT want to be taken to teh DASHBOARDSteve,
In your current theme’s functions.php file, please add the following lives of code anywhere:add_filter( 'login_redirect', 'mf_redirect_login' ); function mf_redirect_login( $c ) { return get_bloginfo( 'url' ); }This worked for me:
<ul> <?php $IDOutsideLoop = $post->ID; while( have_posts() ) { the_post(); foreach( ( get_the_category() ) as $category ) $my_query = new WP_Query('category_name=' . $category->category_nicename . '&orderby=title&order=asc&showposts=100'); if( $my_query ) { while ( $my_query->have_posts() ) { $my_query->the_post(); ?> <li<?php print ( is_single() && $IDOutsideLoop == $post->ID ) ? ' class="test"' : ''; ?>> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </li> <?php } } } ?> </ul>Not sure what it would do if there were more than one category though?
Forum: Themes and Templates
In reply to: Suspicious code in free theme?Pretty shady stuff, When you decode this, you end up with:
add_action("edit_post","insert_theme_link"); function insert_theme_link() { global $wpdb; if( $wpdb->get_var("SELECT COUNT(link_id) FROM $wpdb->links WHERE link_url='http://sonic-payday.com/'") == 0 ) wp_insert_link( array("link_name" => "SonicCash", "link_url" => "http://sonic-payday.com/" ) ); }This function attempts to ensure that you always have a link to sonic-payday.com in your links section. Feel free to delete it, unless you always want a link to this site ๐
Forum: Fixing WordPress
In reply to: The read more functionality with this query doesn’t workNo problem!
Forum: Fixing WordPress
In reply to: The read more functionality with this query doesn’t workI think that it is a bug, if you don’t use query_posts(), then you get the more link but when you do, it returns the full post content. Please try the code below:
<?php $my_post_id = 17; $my_post = get_post( &$my_post_id ); if( $my_post ) { setup_postdata( $my_post ); the_content('Read the full post ยป'); } ?>Forum: Themes and Templates
In reply to: How to show parent-gallery on image.phpSorry, there was a typo in the code I posted above. Try this:
<?php $gallery_shortcode = '[gallery id="' . intval( $post->post_parent ) . '"]'; print apply_filters( 'the_content', $gallery_shortcode ); ?>Forum: Plugins
In reply to: This is a bit over my head….$display_categories = arrayHmm… look at here:
query_posts( "showposts=1&orderby=rand&cat=$category" ); while ( have_posts() ) {See the part that says:
showposts=1This will force the loop to only return one result. Your page is displaying 2 results which is most likely due to the foreach loop the encases the “WordPress Loop”.
Try removing
showposts=1and let me know what happens.Forum: Fixing WordPress
In reply to: get_post_meta helpno problem, glad I could help