Resize image to specific dimension (X to Y ratio)

If the last parameter $crop is true, then »images will be cropped to the specified dimensions using center positions«, with »(…) an array can specify positioning of the crop area« – this is generally called hard crop. But you have to make sure that the images are big enough to actually crop the size you … Read more

Pagination on Custom Post

When you use WP_Query to get post from database, you must have to use next_posts_link() with max_num_pages parameter for our current query. You can do this as below. <?php next_posts_link(‘More &raquo;’, $packages->max_num_pages) ?> Now your code will become this. I have made above changes in following code. <div class=”eight columns”> <ul> <?php $paged = (get_query_var(‘paged’)) … Read more

Parsing Menu Items and Blog Posts

I’m sure what you’re asking can be done, but there’s a far simpler, significantly easier solution, just register each menu multiple times for each language, and show different menus for different languages. This way you don’t need to figure out how to filter out menu items depending on GET variables, and your pages become more … Read more

WP_OPTIONS table, active_plugins entry [closed]

That entry is a PHP serialized array. The serialize method takes an array and stores it’s value as a string so it can be stored elsewhere – like a database. In the above example, the “s:” entries stand for “string:”. With a serialized array, each element’s data type is represented by a letter (a, s, … Read more

Add data-id attribute to child page links

Assuming that your html is outputted by a wordpress menu sitting in a sidebar, you have to extend the Walker_Nav_Menu Class which is used by menu template functions like wp_nav_menu. As stated in the reference of wp_nav_menu, you could modify its output like: class My_DataId_Walker_Nav_Menu extends Walker_Nav_Menu { // other code found in original Walker_Nav_Menu … Read more

What does -> mean in WordPress?

NO -> is not wordpress specific, it is object operator in php. When you want to call a method of an instance then you call the method with -> Class SomeClass{ function example(){ return ‘This is an example function’ } } $obj = new SomeClass(); $obj->example(); // we are calling example function with -> operator … Read more

load ajax using admin-ajax.php

The codex says here that The wp_ajax_ hook follows the format “wp_ajax_$youraction”, where $youraction is your AJAX request’s ‘action’ property. I suppose in your js file you should go for: data: { action: ‘lateral_fluid’, // the $action to run }