Use an anchor link to open an iframe inside a WordPress page

I would approach this one of two ways: Use a target attribute in the link to open it in an iframe (not universal across browsers) Use JavaScript to replace the src attribute on your iframe Option 1: <a href=”https://wordpress.stackexchange.com/questions/118983/somethirdpartysite.com/reg” target=”thirdparty”>Register</a> <iframe name=”thirdparty”></iframe> Option 2: <a href=”https://wordpress.stackexchange.com/questions/118983/somethirdpartysite.com/reg” class=”iframeit”>Register</a> <iframe src=”#” name=”thirdparty”></iframe> <script> $(‘.iframeit’).click(function(event) { event.preventDefault(); var … Read more

Using flickr api in custom wordpress plugin

I see two issues right off the bat that are going to cause problems: $this->myApiKey = $flickr_key; $thix->myApiSecret = $flickr_secret; myApiKey and myApiSecret aren’t in your code anywhere, so setting them here isn’t doing anything. They should be $this->flickr_key and $this->flickr_secret. You have a typo in the 2nd line above. Change $thix to $this and … Read more

How to make the WordPress Editor not accept HTML?

Remove post type support for the editor: add_action( ‘init’, function() { remove_post_type_support( ‘post’, ‘editor’); } ); Now add a new meta box containing only a textarea // print a new meta box function generic_cb($post) { $content = (!empty($post->post_content)) ? $post->post_content : ”; echo ‘<textarea name=”content”>’.$content.'</textarea>’; } function add_before_editor($post) { global $post; add_meta_box( ‘generic_box’, // id, … Read more

Changing wordpress default language

If/When you want to have wordpress in your own language you could/should download the swedish version imho. Go and look here for the translated package. Because thats the best way to do. Only having some language files doesn’t do always the trick. Download the package from the link I mentioned, unzip/untar unrar or whatever you … Read more

How to add PHP pagination to wordpress

you can use paginate_links() from wordpress core API, its make more easily to paginate your custom query. And you dont need to make another query to get all users count. <?php $users_per_page = 10; // total no of author to display $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; if( (int)$paged === 1 ){ $offset = … Read more

How to make sure relative URL works when site is not on root domain?

Make use of the functions wordpress offers to determine paths and URLs – see Determining Plugin and Content Directories. For example use: get_template_directory to Retrieves the absolute path to the directory of the current theme, without the trailing slash. or get_stylesheet_directory to Retrieve stylesheet directory Path for the current theme/child theme. You find more information … Read more