Count and show Clicks on external links in a single page/post

Yes, it is possible. You can do this with ajax call that updates post meta field before the link is followed. In the example, I used admin and non-admin users who click the link and automatic increase link_check_click_counter in the post meta. I used here the example to show the data using wp_footer. You can … Read more

Creating a Link Directory using WordPress?

A great starting point would be Mike’s answer to the question about cloning CrunchBase. You’ll want to do something similar with custom post types for entries in your directory. If you want to allow visitors to submit sites, you could perhaps use the TDO Mini Forms plugin to allow visitors to create a new listing, … Read more

Open external links in a new window

Yup can be done with javascript. var $j = jQuery.noConflict(); $j(document).ready(function() { //external attribute $j(“a:not([@href*=http://YOURSITE.com/])”).not(“[href^=#]”) .addClass(“external”) .attr({ target: “_blank” }); });

Turning Broken URLs Into Search Terms?

You can try a plugin to do this: http://wordpress.org/extend/plugins/smart-404/ Reads the page URL and tries to find a page/post that it might match and redirect to it. Found out about this plugin from: http://www.aebeta.com/web-hosting/seo/7-seo-friendly-404-plugin-for-wordpress.html

Internal Links to Pages in PHP?

Page Permalink from $id If you know the Page $id, use get_permalink(): <?php $permalink = get_permalink( $id ); ?> Page Permalink from $slug If you know the Page $slug, such as /about (including hierarchy, such as /about/work), use get_page_by_path() to determine the Page $id, then use get_permalink(). <?php $page_object = get_page_by_path( $slug ); $page_id = … Read more

Insert Media – Attachment – Link to : Remove the “attachment page” option

These options are hardcoded into the tmpl-attachment-display-settings Underscore media template in the /wp-includes/media-template file: <script type=”text/html” id=”tmpl-attachment-display-settings”> <h3><?php _e(‘Attachment Display Settings’); ?></h3> …cut… <select class=”link-to” data-setting=”link” <# if ( data.userSettings && ! data.model.canEmbed ) { #> data-user-setting=”urlbutton” <# } #>> <# if ( data.model.canEmbed ) { #> <option value=”embed” selected> <?php esc_attr_e(‘Embed Media Player’); ?> … Read more

How to get a page url by a page id?

You’re probably getting that error because WordPress doesn’t have the $wp_rewrite global loaded yet for some reason. Either something deactivated it, or you’re trying to run those functions before WordPress has a chance to load it. If you’re trying to do this in a plugin or in your theme’s functions.php file, make sure you’re inside … Read more