Tag » Wordpress 2

How do I get to my WordPress Media Library?

Two ways come to mind. Reach in through a window or “walk” in through the dashboard. Sorry about this levity, but really these are routes to your… 328 kata lagi

Blogging

Grabbing HTML for an Image and Link for a Text Widget

In my job as a Happiness Engineer for Automattic, I often get asked how to add an image with a link into a widget area. 152 kata lagi

Wordpress

When I add a photo to a WordPress post, where does it go?

That is really a good question because images do not go “into a post”. You actually know the answer, you just might not be aware of it. 251 kata lagi

Blogging

Book Review || The Fault In Our Stars

Title: The Fault In Our Stars

Author: John Green

Genre: Romantic Fiction, Y/A.

Publisher: Penguin Books

Year of Publishing: 2012

Page: 313

ISBN No: 978-0-14-751373-1… 476 kata lagi

General

Search in custom post type title and post meta using MySql query

Search in custom post type title and post meta using MySql query.

global $wpdb;
	$search_val = '';
	if(!empty($post['search_key'])){
		$search_val = '%' . mysql_real_escape_string($post['search_key']) . '%';
	}
	$query = "SELECT p1.ID FROM $wpdb->posts AS p1 ";
	$query .= " INNER JOIN $wpdb->postmeta AS p2 ON (p1.ID = p2.post_id) WHERE 1=1 ";
	
	if(!empty($search_val)){
		$query .= " AND ( (p1.post_title LIKE '$search_val')  ";
		$query .= " OR (p2.meta_key = 'people_title' AND CAST(p2.meta_value AS CHAR) LIKE '$search_val') ";
		$query .= " OR (p2.meta_key = 'office_location' AND CAST(p2.meta_value AS CHAR) LIKE '$search_val') ) ";
	}
	
	$query .= " AND p1.post_type = 'people'  ";
	$query .= " AND p1.post_status = 'publish' ";
	$query .= " GROUP BY p1.ID ORDER BY p1.menu_order ";	
WordPress

Single qutes search In WordPress and PHP

In WordPress

$search = html_entity_decode($searchKey, ENT_QUOTES,  'UTF-8' );
	 
$args = array('post_status'=>"publish",'posts_per_page' => $limit,'offset' => $offset, 'order' => 'DESC' ,'s' => $search, 'post_type' => Array('post', 'page', 'markets' , 'people', 'post','projects','services') );

$result = new WP_Query( $args );
… 59 kata lagi
WordPress

New Year. New Resolutions.

It’s the start of a New Year and a great time to reflect on the progress you’ve made over the past year as you make your new resolutions.   468 kata lagi

Blog