wp_guy
Forum Replies Created
-
Forum: Plugins
In reply to: get category ID from SlugYou can also loop through the categories like this:
foreach(get_categories() as $category){ if($category->slug == $THE_SLUG){ $THE_ID = $category->cat_ID; } }Forum: Themes and Templates
In reply to: Widget problemoh… I thought that whas the whole sidebar… Hmmm… Since the widget title gets echoed inside the widget and not outside as in your code…
if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '<div class="sidebar-head">', 'after_widget' => '</div> <div class="sidebar-footer"></div>', 'before_title' => '<h3>', 'after_title' => '</h3></div> <div class="sidebar-content">', ));But you’re probably going to have problems with widgets that don’t have a title, like the search widget.
Forum: Themes and Templates
In reply to: Graphical Buttons for Sidebar page links?You could do something like this:
<?php foreach(get_pages() as $page){ echo "<a href=\"$page->guid\">"; echo "<img src=\"/images/$page->post_name.jpg\" />"; echo "</a>"; } ?>Forum: Themes and Templates
In reply to: Widget problemThe code in your sidebar should look something like:
<div class="sidebar-head"><h3></h3></div> <ul class="sidebar-content"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <!-- What happens if you don't have the widgets functionality. Static widgets for example. --> <?php endif; ?> </ul> <div class="sidebar-footer"></div>Then, in the functions.php file:
if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', ));And that should do it.
Forum: Fixing WordPress
In reply to: API Key – error – suddenly registered for another wedsite. . . .?I guess you should ask the support team at WordPress.com
Forum: Fixing WordPress
In reply to: Get Month and Day from the_excerpt?Sweet! 🙂
Forum: Fixing WordPress
In reply to: Get Month and Day from the_excerpt?@ivovic: Stupid question but how come your name is linked to your website and mine isn’t?
Forum: Fixing WordPress
In reply to: Get Month and Day from the_excerpt?Aw… You da man Ivovic 😉
Forum: Fixing WordPress
In reply to: Get Month and Day from the_excerpt?You need to put
the_title()inside the loop…<?php query_posts('showposts=1&cat=5'); ?> <?php while (have_posts()) : the_post(); ?> <?php the_title('<span style="font-weight:bold">', '</span>'); ?> <br /> <?php the_content_rss('', TRUE, '', 14); ?> <?php endwhile;?>Forum: Fixing WordPress
In reply to: Get Month and Day from the_excerpt?You can restrict the category you want to show by changing the parameters inside query_posts(). Like:
query_posts('showposts=1&cat=1');, that would show the latest article in the category with ID 1. More info here:
http://codex.ww.wp.xz.cn/Template_Tags/query_posts#Exclude_Categories_From_Your_Home_PageAs for showing the date:
<?php the_time('M j'); ?>Forum: Themes and Templates
In reply to: How to display page’s generating time (seconds) in the footerThis should do it:
Page generated in <?php timer_stop(1); ?> seconds.Forum: Themes and Templates
In reply to: Manipulating Theme TemplatesYou can use the setup_postdata(); function to setup all the necessary variables… like this:
<ul><?php $myposts = &get_posts('numberposts=10'); foreach($myposts as $post) : setup_postdata($post); ?> <li> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <br /><?php the_excerpt(); ?> </li> <?php endforeach; ?></ul>Forum: Themes and Templates
In reply to: Posts Not Lining Up ProperlyHahahaha… happens to me all the time… spend hours trying to find a solution just to find out that I misspelled something 😉
Forum: Themes and Templates
In reply to: Manipulating Theme TemplatesHow about
<?php the_excerpt(); ?>?Forum: Themes and Templates
In reply to: Theme: Connections Reloaded 1.5no problem 😉