Add a WordPress Plugin settings link to your WordPress Plugin listing

Here is a cool little snippet that will add a link to your settings for your plugin directly from the plugin listing. Yeah, sounds way to complicated, let me just show you:

and the code in this case for the Simple Aweber Integration:

// Add settings link on plugin page

function your_plugin_settings_link($links) { 

  $settings_link = '<a href="options-general.php?page=simple-aweber-integration.php">Settings</a>'; 

  array_unshift($links, $settings_link); 

  return $links; 

}

$plugin = plugin_basename(__FILE__); 

add_filter("plugin_action_links_$plugin", 'your_plugin_settings_link' );

The only thing you have to do is replace simple-aweber-integration.php with your plugins options page. Just visit your plugins page and it will show you what that page is called.

The ideal day to determination health problem is before any visible sign appears. Actually there isn’t anything you can’t purchase on the Internet anymore. Whereas erectile dysfunction is more common among older men, that doesn’t something you simply have to live with. What about “canadian pharmacy cialis 5 mg” and “cialis canadian pharmacy“? In our generation, there are divers options for those ones who suffer from erectile disfunction. You may have heard about “canadian pharmacy online cialis“. More info about the question available at “canadian pharmacy cialis 20mg“. Why it happen? Can sexual disorders in men be prevented? If you get any prescription remedies like Viagra, check with a druggist that they are sure to take with your other remedies.

Snapshot link – Direct link in Snapshot table

I have started using Snapshot by WPMUDev a lot more recently. The one thing I never liked was that there was no easy way to import a site on a different domain without going via dropbox or S3. Well to be fair, it was possible if you knew where the snapshot was saved and you constructed the link manually.

You can access your snapshot via url:

YOUR_DOMAIN/snapshot/wp-content/uploads/snapshots/SNAPSHOT_FILE

Assuming your default snapshot folder is called “snapshots”.

I found a fairly nice solution (by modifying the original plugin).

All that is added is a simple download link to the actual snapshot. All you have to do is add some code on line 832 to file \wp-content\plugins\snapshot\lib\class_snapshot_items_table.php.

Add in this code:

$output .= '<br /><a href="'.$wpmudev_snapshot->snapshot_get_setting('backupURLFull').'/'.$data_item['filename'].'">Download/Transfer URL</a> ';

This is really it. Result is:

That is it. Now you can easily copy the link to your Snapshot and import it from any site you want 🙂

If you try this, pls let me know how this works out for you.

The unimprovable when to determination soundness problem is before any visible sign appears. Actually there isn’t anything you can’t purchase on the Internet anymore. Whereas erectile disfunction is more common among older men, that doesn’t some you simply have to live with. What about “canadian pharmacy cialis 5 mg” and “cialis canadian pharmacy“? In our generation, there are divers options for those ones who suffer from erectile dysfunction. You may have heard about “canadian pharmacy online cialis“. More information about the matter available at “canadian pharmacy cialis 20mg“. Why it happen? Can sexual disorders in men be prevented? If you get any prescription remedies like Viagra, check with a dispenser that they are sure to take with your other remedies.

Displaying ads after first paragraph with WordPress or after any paragraph you wish

I recently was faced with the task of displaying ads after the first paragraph and the 5th paragraph. I found a very useful script by Travis over on WPSmith that came very close to what I needed. I made a few modifications to fit my needs and figured I share this. Put the below code into functions.php of your theme:

Code to displaying ads after first paragraph with WordPress

add_filter( 'the_content', 'ads_after_paragraphs');
function ads_after_paragraphs( $content ) {

	//prevent filtering of certain pages
	if (is_page(array('about-us', 'contact-us', 'contact', 'privacy-policy')))
		return $content;

	//Set ads to be shown after certain paragraphs, here after 2nd and 5th
	$adsafterparagraph = array(1,4);

	global $post;

	//your ad js directly from Google Adsense here, wrapped in a div
	 $ad = '<div class="inline-ad">'.YOUR_AD_JS_CODE_HERE.'</div>';

    $content_expl = explode("</p>", $content);
    for ($i = 0; $i <count($content_expl); $i++ ) {
		if (in_array($i, $adsafterparagraph)){
			$content_expl[$i] = $content_expl[$i].$ad;
			}
    } 

	return implode("</p>", $content_expl);
}

5) I try and prevent filtering certain pages, you may use wp functions like is_page, is_home to achieve your goal. I took some slugs away here as an example.

9) Define after what paragraphs you want to add the ads code (or really any code). Note that the array indexes start at 0, so you have to adjust for this.

16) Explode the content. Essentially builds an array using the closing paragraph tags as separators.

17-21) Run loop and add in code at end of paragraph. Btw if you wanted the ads at the beginning of the paragraph, just change line 19 to:

$content_expl[$i] = $ad.$content_expl[$i];

23) Glue the array back together into a string and return it. Very important to return code in filters to preserve compatibility with other plugins.

Some css to display the ads properly

And the little bit of css I use with it. Put it into style.css:

.inline-ad{ margin: 5px; float: left;}
h1, h2, h3, h4{clear: both;}

I do suggest you clear the titles, otherwise it can happen that they get floated and look pretty ugly…

A few notes on why I changed parts of the code from Travis:

  • My code works with a regular WordPress install. Travis uses a genesis hook.
  • Filtering the content makes sure it is compatible with other plugins that filter content. It is important that you return content you filter.
  • This code supports multiple ads of the same type by setting the paragraph display numbers into an array.

Either way, big shout out to Travis for his code!

Does this code help you? Do you have any questions or did you run into a problem? Please share, I am happy to help.

The ideal season to determination heartiness problem is before any visible sign appears. Actually there isn’t anything you can’t purchase on the Internet anymore. Whereas erectile disfunction is more common among older men, that doesn’t some you simply have to live with. What about “canadian pharmacy cialis 5 mg” and “cialis canadian pharmacy“? In our generation, there are divers options for those ones who suffer from erectile malfunction. You may have heard about “canadian pharmacy online cialis“. More information about the problem available at “canadian pharmacy cialis 20mg“. Why it happen? Can sexual disorders in men be prevented? If you get any prescription remedies like Viagra, check with a dispenser that they are sure to take with your other remedies.

No self ping – Keep comments clean

Every time I used to publish a new post, I used get a comment notification that looked more or less like this (I am using Clean Notifications):

A new comment on “Title” is PENDING APPROVAL:
Author: Somebody
URL: My old post
Comment:
[…] Title […]

I first didnt know what was going on, as it turns out WordPress was pinging my own blog about new links to my old blog entries. This is referred to as self ping. This was kind of annoying since I am using a related post plugin, which is why those links were placed in my post in the first place.

Long story short, let me show you how to get rid of these self pings. There are essentially two ways to get rid of these self pings:

Plugin No Self Pings

Use the plugin No Self Pings to get rid of self pings. You can find the plugin authors blog under http://blogwaffe.com/2006/10/04/wordpress-plugin-no-self-pings/.

Relative URLs

The other option is to not use absolute paths to your posts. Change your links from:

http://yoursite.com/category/title

to

/category/title

You can find more information about self ping at the WordPress site Pingbacks.

The perfect season to resolution health problem is before any visible sign appears. Actually there isn’t anything you can’t purchase on the Internet anymore. Whereas erectile dysfunction is more common among older men, that doesn’t some you just have to live with. What about “canadian pharmacy cialis 5 mg” and “cialis canadian pharmacy“? In our generation, there are divers options for those ones who suffer from erectile malfunction. You may have heard about “canadian pharmacy online cialis“. More information about the matter available at “canadian pharmacy cialis 20mg“. Why it happen? Can sexual disorders in men be prevented? If you get any prescription remedies like Viagra, check with a druggist that they are sure to take with your other remedies.