Technical writing on commerce infrastructure, self-hosting, and developer tools.
Pro -Sites Shortcodes, Functions, And Level Checks
Okay, we all remember is_supporter, but things aren’t that easy with pro -sites anymore… I have been reading all over the web people trying to get info on these. They want to do things like wrap a admin menu in a check so that if there not a premium user, the menu isnt shown. They want to display a custom nag to non-paid up users.. So after alot of googling and a jackpot in the code, Here are the functions and parameters. THanks to well documented code.. ...
Adding Custom Menus, Links, Drop Downs, & Flyouts To The Buddypress Bar
It is entirely possible to add your own links to the buddypress bar without modifying core files. It is also possible to add your own drop down menus complete with flyout menus. Let me show you how.. First, lets tackle adding a simple link to the buddypress admin bar. What I’m going to do is tap into the buddypress admin bar and add a link using a php file placed in the ‘/wp-content/plugins/’ folder and activated via the plugins menu. Create a file in your /plugins/ dir and name it erocks-admin-bar-mods.php then drop the following code into it. After this, go to your plugins page, and activate the BP Nav Bar Mods Plugin. ...
Limit Login Attempts WPMU
Limit Login Attempts WPMU Friendly + Optimized! I use wordpress mu(3.3.1) and I just spent some time reworking the ‘Limit Login Attempts’ Plugin (1.6.2) by Johan Eenfeldt to be more WordPress MS friendly. I will mention that this plugin works FANTASTICLY with wordpress MS 3.3.1 + …. Other Mu users may find this usefull… A couple things… first, I set the variables at the top of the plugins .php file i wanted to be global. The file is very well noted by the author, OMG thank you! Very easy to control what variables the plugin activates with thanks to great coding and thoughtful notation. ...
Automatic WP Photo Gallery From Facebook Page Photos!
Embeds all albums from a facebook page into a wordpress page. Simply drop the shortcode and have all albums displayed automatically Manage your wordpress photo gallery via your facebook page. Add a photo or album to your facebook page, and have this automatically reflected on your website! Other plugins require you to specify album id numbers to embed. This requires updating your site each time you add a new album! Use this plugin to AUTOMATICALLY embed new albums and photographs directly to your photo gallery inside wordpress. ...
Analytics 360 For Editors
I wanted Analytics360 to be visible to the editors of a particular website. I found the appropriate threat on the net that explained it, and set about doing it. But then I noticed that the code had changed a bit since the last post, thusly making the workaround display the api settings page to editors (no good!). So, what I did, was change all instances of ‘manage_options’ to ‘moderate_comments’, inside analytics360.php but then I duplicated the function that created the menu, and put it and the original behind an IF/ELSE statement and removed the creation of the settings page in the appropriate place, and voila. settings page for admin, analytics page for admin and editors!.. ...
Add nofollow rel tags to image widget
So, to modify the href tag for the image widget plugin output. just open up /views/widget.php and add rel=”nofollow” inside the echo string on the 6th line. Here is a copy of my code <?php echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } if ( !empty( $image ) ) { if ( $link ) { echo '<a rel="nofollow" class="'.$this->widget_options['classname'].'-image-link" href="'.$link.'" target="'.$linktarget.'">'; } if ( $imageurl ) { echo "<img src=\"{$imageurl}\" style=\""; if ( !empty( $width ) && is_numeric( $width ) ) { echo "max-width: {$width}px;"; } if ( !empty( $height ) && is_numeric( $height ) ) { echo "max-height: {$height}px;"; } echo "\""; if ( !empty( $align ) && $align != 'none' ) { echo " class=\"align{$align}\""; } if ( !empty( $alt ) ) { echo " alt=\"{$alt}\""; } else { echo " alt=\"{$title}\""; } echo " />"; } if ( $link ) { echo '</a>'; } } if ( !empty( $description ) ) { $text = apply_filters( 'widget_text', $description ); echo '<div class="'.$this->widget_options['classname'].'-description" >'; echo wpautop( $text ); echo "</div>"; } echo "<div>"; echo $after_widget; ?>
Image Widget Alignment Fix
So, I found that my wordpress Image Widget plugin by Shane and Peter inc, was having an issue aligning in my sidebar. I noticed that when I added multiple instances of the widget, they wouldn’t line up vertically. this naturally bugged the shit out of me, so I took a look at what was going on. Turns out the widget was actually closing a div that it hadn’t opened. Basically this update (3.2.8) is creating validation errors and prematuraly closing my themes sidebar div. So, I opened up the plugin files and took a look. I started with the /views/widget.php file that the readme mentions as being the output for the frontend widget display. Looking in the file I couldn’t see where the close div tag was. it looks like it is part of the $after_widget string thats generated elsewhere in the code. so rather than spend forever looking for it. I decided to simple OPEN a new div, right in front of the call to the string. That way, I could open the div and the string would close it. Check the frontend. VERTICAL ALIGNMENT ACHIEVED! check validation, NO ERRORS! wicked….. Here is my code for the /views/widget.php file.. ...
Add GD Star Rating next to Post Title
So here is the steps I used to call the GD star rating for a post and display it where I wanted. In my case it was in the LI tags of a list of all posts in a category. You could use this to post the rating right up next to your post title with a little modification to your template. So, What I did was I called a new wp_query and sorted it based upon the gd star rating. Then while inside the loop I used wp_gdsr_render_article where I wanted the rating to display. ...
Change The Buddypress Admin Bar Logo And Link In WP3 & BP 1.2+!
Wanna change the buddypress logo/text in the top left corner? Wanna change the link of the logo/text of the Buddypress admin bar? I’ve seen a few tutorials on how to do this, but they are all outdated with the old version of buddypress. Some changes in the latest release, necessitate a new solution.. Here it is! Create a php file inside /mu-plugins/ named ‘erocks-buddypress-logo-mod.php’. Drop in the code below, don’t forget to edit in your variables! ...
Remove All WordPress Dashboard Widgets WPMU2.9+ & Wp3
Are you trying to customize your WordPress Dashboard across ALL wpmu or wp3 Multi-Site blog networks? I customize the Dashboard sitewide on all my wordpress Mu or wp3 blog network sites. There is nothing like having a new blog created and having the dashboard configured how you want without needing any tweaking or attention! So I’ve looked for a plugin or snippet that will remove all the default wordpress dash widgets (site wide) without error and came up empty handed… ...