Joshuwar
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: WP Survey And Quiz Tool] Additional Text BugAnother Bug: the custom theme directory seems to be wrong (this could do with more documentation generally). It also seems to use a multisite blog id even when on a single instance.
Forum: Plugins
In reply to: Can you stop wp_login_form redirecting to wp-login on fail?Line 273 on includes.php (using WP 3.0.1) seems to control the redirect on login failure.
<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . site_url( 'wp-login.php', 'login' ) . '" method="post">
Changing
wp-login.php
in the code above seems to have the behaviour I’m looking for.BUT! It’s never a good idea to hack the core, and I don’t know whether something else may break if I do this.
What I’d really like to do is write a new function in my functions.php, to be inserted into
wp_login_form();
on includes.php.Is that kind of thing possible? What’s the best course of action here? Can something on functions.php be made to override or add to existing core functions?
Forum: Plugins
In reply to: [Plugin: MapPress Easy Google Maps] Map outside of post contentPut this in the loop:
<?php echo do_shortcode('[mappress]'); ?>
Won’t work on custom page templates though…
Forum: Fixing WordPress
In reply to: MapPress not loading header files on some pagesI’ve noticed this problem too – seems the plugin doesn’t register with wp_head when you’re using a custom page template. Every other page is fine.
Anyone have any pointers on hacking the plugin to make it work?
Forum: Plugins
In reply to: counting attachments and inserting breaks…Er, figured it out- it’s not different at all. Here’s what worked for me, in case it’s handy for anyone:
<?php function attachment_toolbox($size = thumbnail) { if($images = get_children(array( 'post_parent' => get_the_ID(), 'post_type' => 'attachment', 'numberposts' => -1, // show all 'post_status' => null, 'post_mime_type' => 'image', ))) { echo '<br class="clearboth" /><h3>Other Editions:<h3><ul class="otherEds">'; $postcounter = 0; foreach($images as $image) { $attimg = wp_get_attachment_image($image->ID,$size); $atturl = wp_get_attachment_url($image->ID); $attlink = get_attachment_link($image->ID); $postlink = get_permalink($image->post_parent); $atttitle = apply_filters('the_title',$image->post_title); $attcontent = ($image->post_content); echo '<li class="onecolfive left fivecolmargin"><div class="bookimage">'.$attimg.'</div>'; echo '<p><strong>'.$atttitle.'</strong></p>'; echo '<p>'.$attcontent.'</p></li>'; $postcounter++; if ($postcounter % 5 == 0) {; echo '<br class="clearboth" />'; }; } echo '</ul>'; } } ?>
Forum: Plugins
In reply to: Using get_page- is there a better way?Thanks for this. I had no idea about wp_reset_query and didn’t know how to describe it to search for it. Much appreciated.
J
Forum: Plugins
In reply to: How to choose the first letter of the Last word when sorting alphabeticallynobody got any thoughts on this?
Forum: Fixing WordPress
In reply to: How to display the child category of a specific parent category…@mandawahoo: glad you found it useful!
@shakingpaper & @perthmetro: to link to the categories just echo the category link as per bechster’s code mentioned above. For example instead of just echoing the cat_name, try this:
echo '<a href="'.get_category_link($childcat->cat_ID).'">'; echo $childcat->cat_name . '</a>';
If you want to include a seperator just add it into the echo after the cat_name.
Hope that helps…
Forum: Fixing WordPress
In reply to: Gallery images link to attachment_id instead of image url…Hi! Sorry about the delay- That’s got it, absolutely.
Thanks!
Forum: Fixing WordPress
In reply to: Center Theme in Window1. go to your style.css and find #rap
2. remove the lines:
margin-left:70px;
margin-right:auto;3. Replace them with the line:
margin:auto;Bingo!
Forum: Plugins
In reply to: Changing the default length of the_excerptSame issues as Simon here… I’m running 2.8.4, and none of the above solutions seem to have any effect in my functions file… Probably I’m missing something obvious (a brain) but nonetheless, help appreciated…
Forum: Plugins
In reply to: How to show links to other posts from same Category?Hey Ernesto- I like your snippet here- very useful- but is there a way to make the $categoryPosts query output information other than the_title?
I’m trying to make it include an excerpt and thumbnail, but when I add these tags to the the query it presumes they’re to be passed into the php, not displayed.
So I’ve had a fiddle and come up with this, which nearly works, but still has some odd behaviour… Can you see a better way (than using echoes etc) to build a more complicated output?
//Gets category and author info global $wp_query; $cats = get_the_category(); $tempQuery = $wp_query; $currentId = $post->ID; // related category posts $catlist = ""; forEach( $cats as $c ) { if( $catlist != "" ) { $catlist .= ","; } $catlist .= $c->cat_ID; } $newQuery = "posts_per_page=3&cat=" . $catlist; query_posts( $newQuery ); $categoryPosts = ""; $count = 0; if (have_posts()) { while (have_posts()) { the_post(); if( $count<4 && $currentId!=$post->ID) { $count++; echo '<ul>'; $categoryPosts .= ''; echo '<li><h3><a href="' . get_permalink() . '" title="' . the_title( "", "", false ) . '">' . the_title( "", "", false ) . '</a></h3>'; echo '<div class="onecol left topmarginsmall">' . wct_display_thumb() . '</div>'; echo the_excerpt(); echo '</li>'; } echo '</ul>'; } } $wp_query = $tempQuery; ?>
Thanks!
Forum: Fixing WordPress
In reply to: Moving WP from PC to server – problemHey Gilles,
I can’t tell specifically without seeing your php, but it looks like your template/header is using absolute paths to js and css files. If you check the generated source of your webpage you’ll see things like
<link rel="stylesheet" href="https://localhost/skid/wp-content/themes/freshy2/custom_my_style.css" type="text/css" media="screen"/>
You should be using bloginfo php calls like this:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
There plenty of addresses which are stored this way for easy portability. Check out bloginfo in the tags.
There may be other places you are calling the localhost- you could try a database search to see if you’ve got other instances…
Hope this helps.
Forum: Plugins
In reply to: [Plugin: WP sIFR] Changing Line-Height?How frustrating. Anybody find any solutions here?
Forum: Themes and Templates
In reply to: Positioning postsI see you got it working with the masonry script- out of interest- was that difficult?