Austin Matzko
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Loop_start slows blog down“loop_start” is a WordPress action hook. With WordPress by itself, it doesn’t really do anything, so it could be that a plugin is doing something that is slowing everything down. Try disabling plugins to see if that makes a difference.
Forum: Fixing WordPress
In reply to: How to retrieve the content of a page onlyIf you want to assign this template to a particular page, then you need to amend it as so:
<?php /* Template Name: Pure Content */ the_content();and choose “Pure Content” under Attributes > Template when editing a page.
Forum: Themes and Templates
In reply to: Javascript and phpThat’s probably because
wp_list_categoriesuses double quotation marks for its attributes, and you have that markup in double quotation marks for the JavaScript function call:If you look at the markup, it will probably be like this:
new popUp(250 , 0 , 950 , 150 , "header" , "<li class="Whoops!Wrap the HTML in single quotation marks instead:
new popUp(250 , 0 , 950 , 150 , "header" , '<?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0'); ?>'Forum: Fixing WordPress
In reply to: want the most recent post only, on front page.so, perhaps, i’m better off turning the front page into a static page. and then putting the the “blog” on another page. and then putting the “single recent post” on the static front page. logistically, does that make more sense given my desired end result?
In my opinion, this is the best way to go, because otherwise you’re going to run into some complicated paging issues.
Forum: Fixing WordPress
In reply to: want the most recent post only, on front page.Change the first part to:
<?php query_posts(array('showposts' => 1)); get_header(); ?>Forum: Plugins
In reply to: Is ther a Posts in same Category WidgetI don’t know if there exists such a thing, but here is the code to do it:
<?php /* Plugin Name: Post Category Widget Version: 1.0 Description: Widget to show a list of posts from the current post's category. Author: Austin Matzko Author URI: http://www.ilfilosofo.com/ */ function current_category_widget_list($args) { if ( have_posts() && ( is_single() || is_category() ) ) : the_post(); $post_id = get_the_ID(); $post_id = intval($post_id); rewind_posts(); wp_reset_query(); extract($args); $cats = (array) wp_get_post_categories($post_id); $cat_id = ( is_category() ) ? intval(get_query_var('cat')) : intval(array_shift($cats)); $r = new WP_Query("cat=$cat_id"); if ($r->have_posts()) : echo $before_widget . $before_title . sprintf('Recent Posts in "%s"', get_cat_name($cat_id)) . $after_title; ?> <ul> <?php while ($r->have_posts()) : $r->the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li> <?php endwhile; ?> </ul> <?php echo $after_widget; rewind_posts(); wp_reset_query(); endif; endif; } function current_category_widget_list_init() { wp_register_sidebar_widget( 'current-post-category-list', 'Current Category List', 'current_category_widget_list'); } add_action('init', 'current_category_widget_list_init');Forum: Plugins
In reply to: Timthumb and Pics not showing…but code is.What is this “include” sub-directory in your plugins directory? For some reason WordPress thinks it’s a plugin when it’s not. If you go to your admin’s plugin page, it should automatically detect that it’s not really a plugin and deactivate it.
Forum: Fixing WordPress
In reply to: How to retrieve the content of a page onlyIf you really want just the content of a page (in the WordPress sense of “page”), then create a
page.phptemplate file in your theme’s directory with the following content:<?php the_content();Yep, that’s it.
Forum: Themes and Templates
In reply to: Javascript and phpFirst of all, don’t use
wp_list_cats(), as it’s been deprecated. Usewp_list_categories()instead.Second, the code you have there doesn’t make sense:
wp_list_cats()(andwp_list_categories()) outputs the categories as HTML list items, not JavaScript code. If you want a list of categories, just leave off the<script>tags.Forum: Everything else WordPress
In reply to: get_currentuserinfo() performance questionWow. If you’re consistently getting those kinds of performance hits just from using
get_currentuserinfo()then please open a support ticket, as this is a bug that needs to be addressed.To get the current username from the cookie, do the following:
$cookie_data = explode('|', $_COOKIE[LOGGED_IN_COOKIE]); $username = $cookie_data[0];Forum: Plugins
In reply to: Load previous/next posts without whole page reloadSomething like this should get you started:
jQuery('.navigation a').click(function() { jQuery('.menutest').load(jQuery(this).attr('href') + " .menutest"); });Forum: Fixing WordPress
In reply to: RSS ERROR (sidebar widget)What it means is that the cached data object for your RSS feed occasionally doesn’t exist.
But that’s not the real issue. The real issue is that for security purposes a live site should not be displaying any error messages whatsoever, much less warning messages, which is all this is. Contact your host and ask it to disable PHP messages for your site.
Forum: Plugins
In reply to: Write to .htaccessTake a look at the
save_mod_rewrite_rules()function inwp-admin/includes/misc.php, as that’s exactly what it does.Forum: Fixing WordPress
In reply to: want the most recent post only, on front page.If there isn’t already a
home.phptemplate file in your theme, create one by copyingindex.phpashome.php. Then edit it and somewhere at the top put the following:query_posts(array('showposts' => 1));Forum: Themes and Templates
In reply to: Custom field display<?php echo get_post_meta(get_the_ID(), 'test', true); ?>