bandwagon
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] Page Cache URL rewriting is not workingOuch. This one hurt. Lost my theme late last night (I think it got rid of the css and js I was minifying). I got those back on and then, in an effort to get around the htaccess thing, rolled back to 0.9.1.3 and now I have a internal server error and a steaming pile of poo of a site. WP Minify.
Forum: Fixing WordPress
In reply to: Return the install directoryThis solved my problem… placed it in functions.php of my current theme:
`function get_install_dir() {
$get_url = get_bloginfo(‘url’);
$split_values = explode(“/”, $get_url);
echo $split_values[3];
}`To those interested chirping crickets out there, I wanted this in order to customize a multisite installation where several different blogs read from the same theme while calling different versions of images. I can now do this with:
<img src="<?php bloginfo('template_directory'); ?>/graphics/<?php get_install_dir(); ?>/logo.jpg" alt="FacultyCommons" />Forum: Plugins
In reply to: Howto get the post ID displayedI’m a bit surprised the answer to this question is so difficult to find. Or maybe I don’t know where/how to look. I’ve tried the following function, but it’s not working for in my widget (though it does work for me directly when I hard code it into sidebar.php).
`// Works in single post outside of the Loop
function function_name() {
global $wp_query;
$thePostID = $wp_query->post->ID;
}`Forum: Fixing WordPress
In reply to: link to other posts in same categoryLet’s try that again:
I’ve been wanting this same feature and also couldn’t find it as a plugin. I’m no genius with PHP, but I hacked together the following code with some help from this thread. It works for me and leaves out the current post. I have it at the very top of a sidebar that appears only on single.php. It also accounts for a post belonging to multiple categories by showing the posts related to each on separately.
<?php $postid = $post->ID; foreach((get_the_category()) as $category) { echo "<h3>Related Posts in ".$category->cat_name." </h3>"; $postlist = get_posts('category='.$category->cat_name); foreach ($postlist as $post) : $catpostid = $post->ID; if (in_category($category->cat_name) && ($catpostid != $postid)) { ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php } endforeach; } ?>Forum: Fixing WordPress
In reply to: link to other posts in same categoryI’ve been wanting this same feature and also couldn’t find it as a plugin. I’m no genius with PHP, but I hacked together the following code with some help from this thread. It works for me and leaves out the current post. I have it at the very top of a sidebar that appears only on single.php. It also accounts for a post belonging to multiple categories by showing the posts related to each on separately.