javascript onload calling a function of a plugin

A friend created a plugin for me which allows the users to mark posts as read or unread. The code of this plugin is the following : edit of the code ! <?php /** * @package Read-Unread * @version 1.0 */ /* Plugin Name: Read-Unread Plugin URI: http://www.google.fr Description: Read-Unread plugin Author: Moi Version: 1.0 Author URI: http://www.google.fr */ global $wpdb; $table_name = $wpdb->prefix . « users_read »; $sql = « CREATE TABLE IF NOT EXISTS `$table_name` ( `ID_USER` int(11) NOT NULL, `ID_POST` int(11) NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=latin1; »; require_once( ABSPATH .…

Migrate Blogging Platforms

Tools and references to help migrate blogging platforms. Writing and designing a blog can be the greatest thing since sliced cheese, but what happens when you’re no longer happy with your current platform? How does one take what they already have and transport it to something completely different? In this post we’ll take a look at the top ways you as a blogger/CMS user can move from one system to another without breaking a cold sweat. WordPress A free and open source blogging tool and a content management system (CMS)…

Web Design Weekly #147

Headlines Responsive Images – Use Cases and Documented Code Snippets The new element can be verbose and confusing, because it solves a range of use cases. To help you match your requirements to the responsive image syntax, Andreas Bovens has prepared an article full of great examples and code snippets to make things easier. (dev.opera.com) Putting Thought Into Things A beautiful article by Oliver Reichenstein that leaves you inspired to put a little more effort and thought into what we build. (ia.net) Articles The Principles of Adaptive Design Brad Frost…

Getting URL of archive (category) page

I’m trying to retrieve the current URL of the page, which works everywhere except for archive pages, for example, a category page. On a category page, it shows as the most recent post in that category. $this_id = $wp_the_query->get_queried_object_id(); $this_url = get_permalink($this_id); echo $this_url; // Should show like: http://domain.com/blog/category How do I retrieve the actual archive page URL? Source: https://wordpress.stackexchange.com/feeds

Custom Search Query – include only custom fields and title

I have a custom post type and I also need a custom search. I want the post title and two custom fields to be indexed/queried. I found solutions for title only and for custom fields but not for both so I tried to combine. Why doesn’t this work? function custom_search( $search, &$wp_query ) { global $wpdb; if ( empty( $search ) ) return $search; // skip processing – no search term in query $q = $wp_query->query_vars; $n = ! empty( $q[‘exact’] ) ?  » : ‘%’; $search = $searchand =…

Have different number of posts on first page

I need to have a different amount of posts per page on the first page that on the other pages. For example, this is what I need Total posts: 6 First page: showing 3 posts Following page: showing 2 posts per page Here’s my code: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $fp_limit = 3; // first page limit $limit = 2; // following page limit $offset = 0; // default offset if( $paged == 1 ) { $limit = $fp_limit; } else { $offset = $fp_limit + ( ($paged…

Sass Source Maps in Chrome

Over the last few years there has been some major advancements in the tooling we use on a day-to-day basis but one feature that really took things to the next level was the introduction to CSS source maps. CSS source maps allow the browser to map CSS generated by a pre-processor back to the original source file. Setting up source maps only takes a couple of minutes in Chrome and gives your editing workflow less friction to enable you to develop quicker. {{< youtube //www.youtube.com/embed/tQdbJHtu6kU >}} Running time: 4:06 Download…

Web Design Weekly #146

Headlines Optimising for 60fps everywhere There is no silver bullet in the matter of making web pages and web apps render efficiently. The best approach is to understand the different things that can cause a page to render slowly and optimise them in turn, following some basic rules and best practices. (engineering.gosquared.com) Everything you need to know about Sass 3.4 (phase2technology.com) Articles Authoring Critical Above-the-Fold CSS Serving the critical CSS in-lined in webpages has become a hot topic of late. In this article Ben Edwards gives a bit of background…

Sorting meta_value as integer doesn’t work

This plugin uses the below chunk of code to print the top 10 highscores. But this doesn’t get the list of top 10 scores sorted by meta_value in my WP install $scoreboard = new WP_User_Query( array( ‘number’ => $top, ‘exclude’ => array( $exclude ), ‘orderby’ => ‘meta_value’, ‘order’ => ‘DESC’, ‘meta_key’ => ‘wp2048_score’, ‘meta_value’ => ‘0’, ‘meta_compare’ => ‘>’, ) ); what could be wrong? I tried using meta_value_num too for orderby but still won’t work. Am on wordpress 3.9.1 Source: https://wordpress.stackexchange.com/feeds