simplistik
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Loop is causing white screentry turning on error reporting and see what it says:
<?php ini_set('display_errors',1); error_reporting(E_ALL ^ E_NOTICE); ?>put that at above your current code.
also you need to have
<?php endwhile; ?>somewhere i don’t see it there but it also looks like you didn’t post all the code either.Forum: Fixing WordPress
In reply to: Getting rid of facebook link?Hrm … I just looked at the theme code and if you delete the lines
<div class="post-meta"> <ul> <li><?php comments_popup_link( __('Leave your comment', 'jenny'), __( '1 comment', 'jenny'), __('% comments', 'jenny')); ?> • <?php the_category(' • ');?></li> <?php the_tags( __('<li>Tagged as: ', 'jenny'), ' • ', '</li>'); ?> <li><?php _e('Share on ', 'jenny'); ?><a href="http://twitter.com/home?status=Currently reading: <?php the_title_attribute(); ?> <?php the_permalink(); ?>"><?php _e('Twitter','jenny'); ?></a>, <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php the_title_attribute(); ?>"><?php _e('Facebook', 'jenny'); ?></a>, <a href="http://del.icio.us/post?v=4;url=<?php the_permalink(); ?>"><?php _e('Delicious', 'jenny'); ?></a>, <a href="http://digg.com/submit?url=<?php the_permalink(); ?>"><?php _e('Digg', 'jenny'); ?></a>, <a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title_attribute(); ?>"><?php _e('Reddit', 'jenny'); ?></a></li> <?php edit_post_link(__('Edit this post','jenny'), '<li>', '</li>'); ?> </ul> </div>it should remove all of it
Forum: Fixing WordPress
In reply to: Photo in scrolling feature sectionLooking at the theme code it looks like the pages you have featured are supposed to accept a custom field called thumbnail.
$thumbnail = get_post_meta($post_id, 'thumbnail', true); if( isset($thumbnail) && !empty($thumbnail) ): $html .= '<img src="'.$thumbnail.'" alt="'.$post_title.'" />'; endif;But if you haven’t done that then try it. Try creating a custom field w/ the name of thumbnail then for it’s value do /wp-content/themes/DarkSky/screenshot.png it should add that theme’s screenshot thumbnail.
Why it doesn’t use post thumbnail is odd.
Forum: Fixing WordPress
In reply to: Getting rid of facebook link?probably just need to open up the index.php and remove the lines that contain the post-meta div.
Forum: Fixing WordPress
In reply to: How to display content for specific users ?can always use the members plugin: http://wordpress.org/extend/plugins/members/
Forum: Fixing WordPress
In reply to: Restrict certain pages for employees only?http://wordpress.org/extend/plugins/members/ is always money
Forum: Fixing WordPress
In reply to: Changed URL and now lost admin accesstaking into consideration the computer illiteracy, alternatively couldn’t you just make a simple php file in the root of the wp install that does something like this:
somefilename.php
<?php include_once('load.php'); update_option( 'siteurl', 'http://hopperscrossingpersonaltraining.com.au/members' ); update_option( 'home', 'http://hopperscrossingpersonaltraining.com.au/members' ); ?>access the file directly:
http://hopperscrossingpersonaltraining.com.au/somefilename.php
and then delete the file once you’re done
Forum: Fixing WordPress
In reply to: Blog Previous and Next links not working properlyhttp://codex.wordpress.org/Function_Reference/query_posts
you need to add “$paged” when you used query_posts or else it won’t paginate properly
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=-13&paged=' . $paged); ?>Forum: Fixing WordPress
In reply to: WordPress redirect isssueYou may need to do a couple things. You’ll need to log into your database and change all instances of http://www.dougkercher.com/mdc to http://www.cleanmyclothes.com.au you will also need to do the same in your wp-config.php file there will be one line that has your old address in it if you haven’t changed it.
Forum: Fixing WordPress
In reply to: Change Permalink ID to page NameForum: Fixing WordPress
In reply to: Youtube Channel Subscribe Link in my Bloghtml … just create an anchor and use this as the href
http://www.youtube.com/subscription_center?add_user=yourusernameForum: Fixing WordPress
In reply to: parse error and can’t get into dashboardopen up functions.php in the directory it’s telling you and fix the parse problem it’s telling you around line 48. it’s nothing you can fix through the dashboard or admin. it’s a problem in your coding and you need to fix the physical file.
Forum: Plugins
In reply to: [Plugin: Classy wp_list_pages] “last” class not properly placing againIf you’re interested I have a fully working version (so far as I can tell) I based it off of your 1.3 code though and not your 1.3.1 (which is what is in the above posts) code. I know you put some work into 1.3.1.
I did that because 1.3 worked in terms of class placement, just not on the last parent item. This should properly add the “last” class to the last parent item, while maintaining all it’s other functionality, and keeping true to code you wrote and are familar with. Also includes the 2.8 register updates with legacy support (I think, we don’t have any blogs under 2.8). Tweak it as you will … or don’t use it at all. We just needed the plug-in to work by the end of today so I took the liberty of doing it, until an official patch. Doesn’t have the uninstall code added to 1.3.1 though.
add_filter('wp_list_pages','c_wp_lp_filter'); add_action('admin_menu', 'c_wp_lp_add_menus'); $c_wp_lp_options = array('c_wp_lp_prefix' => 'Class prefix', 'c_wp_lp_sep' => 'Class separator', 'c_wp_lp_attr' => 'Attribute', 'c_wp_lp_first_class' => 'Class to add to first element', 'c_wp_lp_last_class' => 'Class to add to last element'); add_action('admin_init', 'classy_wp_list_pages_init' ); function classy_wp_list_pages_init() { global $c_wp_lp_options; if( function_exists( 'register_setting' ) ) { foreach ( $c_wp_lp_options as $k => $v ) { register_setting( 'classy-wp-list-pages' , $k ); } } } $c_wp_lp_values = array(); /************************************** wp_list_pages() filter ***************************************/ function c_wp_lp_filter_callback($matches) { global $c_wp_lp_values; $prefix = (strlen($c_wp_lp_values['c_wp_lp_prefix'])) > 0 ? $c_wp_lp_values['c_wp_lp_prefix'] . $c_wp_lp_values['c_wp_lp_sep'] : ''; // build the identifier // - strip trailing and preceding slashes // - replace the remaining slashes with the separator (from get_options()) $identifier = ''; if( $matches[4] && !empty($matches[4]) ) { $identifier = preg_replace('/(^\/|\/$)/', '', $matches[4]); $identifier = str_replace('/', $c_wp_lp_values['c_wp_lp_sep'], $identifier); } else { // if the url is blank, this is the homepage $identifier = 'frontpage'; } $identifier = $prefix . $identifier; $filtered = ''; if( $c_wp_lp_values['c_wp_lp_attr'] == 'id' ) { $filtered = sprintf("<li id=\"%s\"%s><a href=\"%s\"", $identifier, $matches[1], get_option('home') . '/' . $matches[4]); } else { // append any existing classes and trim out extra spaces $class = $identifier . ' ' . trim($matches[2]); $class = preg_replace('/[ ]+/', ' ', $class); $filtered = sprintf("<li class=\"%s\"><a href=\"%s\"", $class, get_option('home') . '/' . $matches[4]); } return $filtered; } function c_wp_lp_filter($content) { global $c_wp_lp_values; // load plugin options from the database $c_wp_lp_values = c_wp_lp_get_values(); // escape the blog's base URL $url = preg_replace(array('/\//', '/\./', '/\-/'), array('\/', '\.', '\-'), get_option('home')); $pattern = '/<li( class=\"([\w\s_\-]+)\")?><a href=\"' . $url . '(\/([\w\-_\/]+))?"/i'; $content = preg_replace_callback($pattern, "c_wp_lp_filter_callback", $content); // add class to first list item if ( !empty($c_wp_lp_values['c_wp_lp_first_class']) ) { $content = preg_replace('/(<ul>|^)[\s]*<li([\s]*id=("[\w_-]+"|\'[\w_-]+\')[\s]*)? class="/i', "$1<li$2 class=\"" . $c_wp_lp_values['c_wp_lp_first_class'] . ' ', $content, -1); } // add class to last list item if ( !empty($c_wp_lp_values['c_wp_lp_last_class']) ) { // reverse the string to make things easier $content_rev = strrev($content); $pages = get_pages('sort_order=DESC&sort_column=menu_order&parent=0&number=1'); $last_page = $pages[0]; $last_page = $last_page->post_name; // match an <li... next to a </ul> or and EOL $content_rev = preg_replace('/(\A|>lu\/<)[\s](.*)"=ssalc([\s]*("[\w_-]+"|\'[\w_-]+\')=di[\s]*)? il</imu', "$1$2 " . strrev($c_wp_lp_values['c_wp_lp_last_class']) . "\"=ssalc$3 il<", $content_rev, -1); $content = strrev($content_rev); $content = preg_replace( array('/<li[\s]id="' . $last_page . '"[\s]class="(.*)">/i', '/<li[\s]id="' . $last_page . '"[\s]class="last[\s](.*)">/i'), array('<li id="' . $last_page . '" class="last $1">','<li id="' . $last_page . '" class="last $1">'), $content ); } return $content; } /************************************** Menu functions ***************************************/ function c_wp_lp_add_menus() { add_options_page('Classy wp_list_pages Options', 'Classy wp_list_pages', 8, 'c_wp_lp_options', 'c_wp_lp_options_page'); } // read this plugin's options from the database function c_wp_lp_get_values() { global $c_wp_lp_options; $opt_values = array(); foreach( $c_wp_lp_options as $k => $v ) $opt_values[$k] = get_option($k); // default value for separator is an underscore if(strlen(trim($opt_values['c_wp_lp_sep'])) < 1) $opt_values['c_wp_lp_sep'] = '_'; // default value for attribute is ID if(strlen(trim($opt_values['c_wp_lp_attr'])) < 1) $opt_values['c_wp_lp_attr'] = 'id'; return $opt_values; } function c_wp_lp_options_page() { global $c_wp_lp_options; echo '<div class="wrap">'; echo "<h2>" . __( 'Classy wp_list_pages Options', 'c_wp_lp_trans_domain' ) . "</h2>"; // options form ?> <form method="post" action="options.php"> <?php global $wp_version;?> <?php if ( version_compare( $wp_version, '2.8', '<' ) ): ?> <?php wp_nonce_field('update-options'); ?> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="c_wp_lp_attr,c_wp_lp_prefix,c_wp_lp_sep,c_wp_lp_first_class,c_wp_lp_last_class" /> <?php else: ?> <?php settings_fields('classy-wp-list-pages'); ?> <?php endif; ?> <p>Should the identifier be applied to the class or ID attribute?<br /><br /> <?php _e("Attribute:", 'c_wp_lp_trans_domain' ); ?> <select name="c_wp_lp_attr"> <option value="id"<?php echo get_option('c_wp_lp_attr') == 'id' ? ' selected="selected"' : ''; ?>>ID</option> <option value="class"<?php echo get_option('c_wp_lp_attr') == 'class' ? ' selected="selected"' : ''; ?>>Class</option> </select> </p><hr /> <p>An optional string appended to the beginning of the generated identifier (letters and numbers only).<br /><br /> <?php _e("Prefix:", 'c_wp_lp_trans_domain' ); ?> <input type="text" name="c_wp_lp_prefix" value="<?php echo get_option('c_wp_lp_prefix'); ?>" size="5"> </p><hr /> <p>What character should separate each token in the identifier?<br /><br /> <?php _e("Token separator:", 'c_wp_lp_trans_domain' ); ?> <select name="c_wp_lp_sep"> <option value="-"<?php echo $opt_values['c_wp_lp_sep'] == '-' ? ' selected="selected"' : ''; ?>>Dash (-)</option> <option value="_"<?php echo $opt_values['c_wp_lp_sep'] == '_' ? ' selected="selected"' : ''; ?>>Underscore (_)</option> </select> </p><hr /> <p> <?php _e("Class to add to the first list item:", 'c_wp_lp_trans_domain' ); ?> <input type="text" name="c_wp_lp_first_class" value="<?php echo get_option('c_wp_lp_first_class'); ?>" size="25"> </p><hr /> <p> <?php _e("Class to add to the last list item:", 'c_wp_lp_trans_domain' ); ?> <input type="text" name="c_wp_lp_last_class" value="<?php echo get_option('c_wp_lp_last_class'); ?>" size="25"> </p><hr /> <p class="submit"> <input type="submit" name="Submit" value="<?php _e('Update Options ยป', 'c_wp_lp_trans_domain' ) ?>" /> </p> </form> </div> <?php } ?>Forum: Plugins
In reply to: [Plugin: Classy wp_list_pages] “last” class not properly placing againJust as a note I did this to line 125 to “fix” the “last” attribute:
$t = str_replace('meti_egap', "meti_egap $rev_class", $t);simple and effective not sure if that’s the best way but it works far as i can tell.
if ( stripos($t, 'meti_egap') !== FALSE ) { $t = str_replace('meti_egap', "meti_egap $rev_class", $t); $list_depth -= 1; }Forum: Plugins
In reply to: [Plugin: Classy wp_list_pages] Does not work with WPMU 2.8Not a problem I like to help where I can ๐