ID; $at_flag = get_post_meta( $postid, '_at_widget', TRUE ); if (is_home() || is_front_page()) { if($at_flag == '' || $at_flag == '1'){ $content = self::_buildDiv(self::AT_ABOVE_POST_HOME) . self::_buildDiv(self::AT_CONTENT_ABOVE_POST_HOME) . $content; $content .= self::_buildDiv(self::AT_BELOW_POST_HOME); $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST_HOME); } } else if (is_page()) { if($at_flag == '' || $at_flag == '1'){ $content = self::_buildDiv(self::AT_ABOVE_POST_PAGE) . self::_buildDiv(self::AT_CONTENT_ABOVE_POST_PAGE) . $content; $content .= self::_buildDiv(self::AT_BELOW_POST_PAGE); $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST_PAGE); } } else if (is_single()) { if($at_flag == '' || $at_flag == '1'){ $content = self::_buildDiv(self::AT_ABOVE_POST) . self::_buildDiv(self::AT_CONTENT_ABOVE_POST, false) . $content; $content .= self::_buildDiv(self::AT_BELOW_POST); $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST, false); } } else if (is_category()) { if($at_flag == '' || $at_flag == '1'){ $content = self::_buildDiv(self::AT_ABOVE_POST_CAT_PAGE) . self::_buildDiv(self::AT_CONTENT_ABOVE_CAT_PAGE) . $content; $content .= self::_buildDiv(self::AT_BELOW_POST_CAT_PAGE); $content .= self::_buildDiv(self::AT_CONTENT_BELOW_CAT_PAGE); } } else if (is_archive()) { if($at_flag == '' || $at_flag == '1'){ $content = self::_buildDiv(self::AT_ABOVE_POST_ARCH_PAGE) . self::_buildDiv(self::AT_CONTENT_ABOVE_ARCH_PAGE) . $content; $content .= self::_buildDiv(self::AT_BELOW_POST_ARCH_PAGE); $content .= self::_buildDiv(self::AT_CONTENT_BELOW_ARCH_PAGE); } } } return $content; } /** * Build toolbox div * * @param string $class Class name * * @return string */ private static function _buildDiv($class, $inline_data = true) { $title = get_the_title(); $url = get_permalink(); if($inline_data == true){ return "