geoken
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: bbpress vs Simple PressIf you need to do any kind of access control BBPress is currently very bad. Something basic like having a forum accessible only by certain members is not currently possible on BBPress.
Forum: Hacks
In reply to: Check Internet Connection Before Proceed to LinkThis stackoverflow post
http://stackoverflow.com/questions/2384167/check-if-internet-connection-exists-with-javascript
describes various methods to check if you’re online.For your purposes, you’d likely want to use JS to intercept every click on a link. Within your function that intercepts clicks, you’d use one of the above methods to check if the user is online; if they are navigate to the URL and if they aren’t do some other action.
If you implement this you’ll need to make a decision on checking online status every time a link is clicked (and significantly slowing down the performance of your site) or checking at some random interval and simply setting some variable.
Forum: Plugins
In reply to: Inserting a Contact Form 7 form in a template fileWhat specific downsides will we face when using this method? I’m building a theme and I want to keep a persistent contact form in the footer (input fields hidden by default and shown when user clicks the contact us link).
My original idea was to create an actual contact page and load in the div that contact form 7 is sitting in via ajax, but I thought actually placing the contact form on the page and simply hiding it until needed would be a more dependable solution (until you said we might get some issues).
Forum: Fixing WordPress
In reply to: Display sub pages sub page parent in sidebarI spent a while playing with this as well. The above post got me halfway there but I wanted it to act exactly like the page in the first post (link needs to be in the submenu’s UL and it needs to be an actual link and not just a heading).
Here’s the code I got. The link is clickable and it applies the current_page_item class to itself if it’s the currently selected page (that way whatever CSS you’re using for indicating the currently selected page will extend to this).
I’m note sure how to insert the ampersand without them getting formatted so you’ll need to go through this code block and change them over if you’re just cutting and pasting
<?php if($post->post_parent){ $id = $post->post_parent; $parent_title = get_the_title($post->post_parent); $parent_link = get_permalink($id); $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); $cls = ""; }else{ $id = $post->ID; $parent_link = get_permalink($id); $parent_title = get_the_title($post->ID); $children = wp_list_pages("title_li=$child_of=".$post->ID."$echo=0"); $cls = "current_page_item"; } if ($children) { ?> <ul> <li class="<?php echo $cls ?>"> <a href="<?php echo $parent_link ?>"><?php echo $parent_title; ?></a> </li> <?php echo $children; ?> </ul> <?php } ?>