Skip to content

Commit

Permalink
featuredURL full image
Browse files Browse the repository at this point in the history
  • Loading branch information
lastguest committed Apr 9, 2015
1 parent 575615f commit fa894f8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions classes/AeriaPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function update($fields=array()){
return $this->id == wp_update_post($fields);
}


public function loadAsPage($id){
if($id){
$t_post = is_numeric($id)?get_page($id):get_page_by_path($id);
Expand Down Expand Up @@ -120,15 +119,20 @@ protected function get_thumbs(){
return (object)$results;
}

public function featuredURL(){
if(null===$this->_featured){
if (has_post_thumbnail($this->id)) {
$this->_featured = wp_get_attachment_thumb_url(get_post_thumbnail_id($this->id));
}else{
$this->_featured = false;
public function featuredURL($full=false){
if ($full) {
$th = $this->get_thumbs();
return $th->big;
} else {
if(null===$this->_featured){
if (has_post_thumbnail($this->id)) {
$this->_featured = wp_get_attachment_thumb_url(get_post_thumbnail_id($this->id));
}else{
$this->_featured = false;
}
}
return $this->_featured;
}
return $this->_featured;
}

public function taxonomy($taxname){
Expand Down Expand Up @@ -390,4 +394,4 @@ static function insert($data,$meta=array()){
function manual_order_wp($posts){
usort($posts, function($a,$b){return ($a->menu_order==$b->menu_order)?0:($a->menu_order>$b->menu_order?1:-1); });
return $posts;
}
}

0 comments on commit fa894f8

Please sign in to comment.