public static function show_edit_columns_content($column) { global $post; switch ($column) { case "image": echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>'; break; case "image_count": $custom = get_post_custom($post->ID); $tmm_gallery = unserialize(@$custom["thememakers_gallery"][0]); if (empty($tmm_gallery)) { $tmm_gallery = array(); } echo count($tmm_gallery); break; } }
public static function show_edit_columns_content($column) { global $post; switch ($column) { case "image": echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>'; break; case "twitter": echo get_post_meta($post->ID, 'twitter', true); break; case "facebook": echo get_post_meta($post->ID, 'facebook', true); break; case "dribble": echo get_post_meta($post->ID, 'dribble', true); break; } }
public static function create_theme_scheme() { $upload_folder = TMM_Helper::get_upload_folder(); $upload_folder .= 'almera' . "/"; if (!file_exists($upload_folder)) { mkdir($upload_folder, 0777); } $upload_folder .= "theme_schemes"; if (!file_exists($upload_folder)) { mkdir($upload_folder, 0777); } //*** $name = strtolower(sanitize_file_name($_REQUEST['name'])); if (empty($name)) { exit; } //copy file custom1.css and rename it to $name.css copy(TMM_THEME_PATH . '/css/custom1.css', $upload_folder . '/' . $name . '.css'); //create file with js presets file_put_contents($upload_folder . '/' . $name . '.js', serialize($_REQUEST['js_data'])); //scheme data $scheme_data = array('key' => $name, 'name' => $_REQUEST['name'], 'color' => $_REQUEST['color']); file_put_contents($upload_folder . '/' . $name . '.data', serialize($scheme_data)); //*** echo $name; exit; }
$_REQUEST['sidebar_position'] = 'sbr'; $sidebar_position = 'sbr'; } } ?> <!-- - - - - - - - - - - - - - - - Dynamic Content - - - - - - - - - - - - - - - - --> <div id="wrapper" class="<?php echo $sidebar_position; ?> " <?php if ($_REQUEST['PAGE_ID'] > 0) { ?> style="<?php echo TMM_Helper::get_page_backround($_REQUEST['PAGE_ID']); ?> "<?php } ?> > <div id="content"> <!-- - - - - - - - - - - - - - Container - - - - - - - - - - - - - - - - --> <div class="container ajax"> <?php $slider_html = ""; if ($_REQUEST['PAGE_ID'] > 0 and is_object($post)) { $slider_html = TMM_Ext_Sliders::draw_page_slider($_REQUEST['PAGE_ID']);
<?php } ?> <?php break; default: ?> <?php if (has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?> " class="single-image link-icon"><img src="<?php echo TMM_Helper::get_post_featured_image($post->ID, $thumb_size); ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php break; } ?> <?php if (TMM::get_option("blog_listing_show_date")) {
public static function show_edit_columns_content($column) { global $post; switch ($column) { case "image": echo '<img alt="' . $post->post_title . '" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>'; break; case "count": echo self::get_page_slides_count($post->ID); break; } }
</div> <div class="clear"></div> <div class="one-half"> <?php TMM_Helper::draw_html_option(array('type' => 'select', 'title' => __('Border width', 'almera'), 'shortcode_field' => 'row_border_width', 'id' => 'row_border_width', 'options' => array(0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5), 'default_value' => 0, 'description' => '')); ?> </div> <div class="clear"></div> <div class="one-half"> <?php TMM_Helper::draw_html_option(array('type' => 'select', 'title' => __('Border type', 'almera'), 'shortcode_field' => 'row_border_type', 'id' => 'row_border_type', 'options' => array('solid' => __('Solid', 'almera'), 'dashed' => __('Dashed', 'almera'), 'dotted' => __('Dotted', 'almera')), 'default_value' => 'solid', 'description' => '')); ?> </div> <div class="clear"></div> <div class="one-half"> <?php TMM_Helper::draw_html_option(array('title' => __('Border Color', 'almera'), 'shortcode_field' => 'row_border_color', 'type' => 'color', 'description' => '', 'default_value' => '', 'id' => 'row_border_color')); ?> </div> </div> <div class="clear"></div> </div> </div> </div> <!-- programmer realmag777 -->
while ($query->have_posts()) { $query->the_post(); ?> <li> <?php if ($instance['show_thumbnail'] == 'true') { ?> <div class="image-holder"> <a href="<?php the_permalink(); ?> "> <img src="<?php echo TMM_Helper::get_post_featured_image($post->ID, '60*60', true); ?> " alt="<?php the_title(); ?> "> </a> </div> <?php } ?> <div class="post-holder"> <h6><a href="<?php the_permalink();
echo $options['direction']; ?> "> <ul class="slides"> <?php foreach ($slides as $slide_num => $slide) { ?> <?php if (!isset($alias) or empty($alias)) { $alias = "910*430"; } //*** $slide_url = TMM_Helper::get_image($slide['imgurl'], $alias); $slide_description_font_family = $slide['flex']['field_values']['description']['font_family']; $slide_description_font_size = $slide['flex']['field_values']['description']['font_size']; $slide_description_font_color = $slide['flex']['field_values']['description']['font_color']; $style = ""; if (!empty($slide_description_font_family)) { $style .= 'font-family:' . $slide_description_font_family . ';'; } if (!empty($slide_description_font_size)) { $style .= 'font-size:' . $slide_description_font_size . 'px;'; } if (!empty($slide_description_font_color)) { $style .= 'color:' . $slide_description_font_color . ';'; } ?>
<li class="gallery_item"> <img class="gallery_thumb" src="<?php echo TMM_Helper::resize_image($imgurl, "100*100"); ?> " alt="" /> <input type="hidden" value="<?php echo $imgurl; ?> " class="post_pod_gallery_item" name="post_type_values[gallery][]"> <a href="#" class="delete_gallery_item" title="<?php _e("Delete Item", 'almera'); ?> "><?php _e("Delete Item", 'almera'); ?> </a> </li>
<?php global $wp_query; ?> <?php if (!empty($wp_query->query_vars['posts_per_page'])) { ?> <?php if ($wp_query->query_vars['posts_per_page'] < $wp_query->found_posts) { ?> <div class="wp-pagenavi"> <?php if (true) { TMM_Helper::pagenavi(); } else { wp_link_pages(); } wp_reset_query(); ?> </div><!--/ .wp-pagenavi --> <?php } } ?> <!-- - - - - - - - - - - end Pagination - - - - - - - - - - - - - -->
<ul class="recent-projects"> <?php if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <li> <?php if ($instance['show_thumbnail'] == 'true') { ?> <a class="single-image link-icon" href="<?php the_permalink(); ?> "> <img src="<?php echo TMM_Helper::get_post_featured_image($post->ID, '440*270', true); ?> " alt="<?php the_title(); ?> "> </a> <?php } ?> <?php if ($instance['show_title']) { ?> <h6><a href="<?php
public static function display_share_buttons($style, $post_id, $buttons) { if (class_exists('TMM_Helper')) { TMM_Helper::display_share_buttons($style, $post_id, $buttons); } }
<!-- - - - - - - - - - - - - end Container - - - - - - - - - - - - - - - - --> </div> </div><!--/ #wrapper--> <!-- - - - - - - - - - - - - - - - Dynamic Content - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - - end Header - - - - - - - - - - - - - - - - --> <!-- - - - - - - - - - - - - - - Footer - - - - - - - - - - - - - - - - --> <footer id="footer" <?php if ($_REQUEST['PAGE_ID'] > 0) { echo TMM_Helper::get_footer_bg($_REQUEST['PAGE_ID']); } ?> > <div class="container"> <div class="sixteen columns"> <div class="eight columns alpha"> <div class="copyright"> <?php echo TMM::get_option("copyright_text"); ?> </div><!--/ .copyright-->
$images = explode('^', $titles); $links = explode('^', $content); ?> <?php if (!empty($images)) { ?> <ul class="clients-items clearfix"> <?php foreach ($images as $key => $img_src) { ?> <li class="<?php if ($animation) { echo $animation; } ?> "> <a href="<?php echo !empty($links[$key]) ? $links[$key] : '#'; ?> "><img alt="" src="<?php echo TMM_Helper::resize_image($img_src, ''); ?> "></a> </li> <?php } ?> </ul> <?php }
<div class="entry-body row_container"> <div class="event-desc nine columns"> <?php if ($event['featured_image_src']) { ?> <div class="work-item"> <a href="<?php echo $event['url']; ?> "> <figure> <img src="<?php echo TMM_Helper::resize_image($event['featured_image_src'], '500*260'); ?> " alt="<?php echo $event['title']; ?> "> </figure> </a> </div> <?php } ?> <p><?php echo $event['post_excerpt'];
public static function get_resized_image_url() { echo TMM_Helper::resize_image($_REQUEST['imgurl'], $_REQUEST['alias']); exit; }
} // Styles if (!empty($styles)) { $styles = 'style="' . $styles . '"'; } $html .= $action == "link" ? '<div class="work-item">' : '<div>'; if (!empty($align)) { $css_class .= $align . ' '; } if (!empty($animation)) { $css_class .= $animation; } if (!empty($css_class)) { $css_class = 'class="' . $css_class . '"'; } $src = TMM_Helper::resize_image($image_url, $image_size_alias); $html .= '<img ' . $css_class . ' alt="' . $image_alt . '" ' . $styles . ' src="' . $src . '" />'; if ($action == "link") { $html .= '<div class="image-extra"> <div class="extra-content"> <div class="inner-extra"> <a class="single-image link-icon" href="' . $image_action_link . '" target="' . $target . '"></a> </div><!--/ .inner-extra--> </div><!--/ .extra-content--> </div><!--/ .image-extra-->'; } $html .= '</div><!--/ .work-item-->';
public static function import_demo_data() { //FIRSTLY LETS CHESK IS CUSTOMER UPLOAD DATA FILES IN wp_content/uploads $wp_options = file_exists(TMM_Helper::get_upload_folder() . 'almera' . '/wp_options.dat'); $wp_postmeta = file_exists(TMM_Helper::get_upload_folder() . 'almera' . '/wp_postmeta.dat'); $demo_db = file_exists(TMM_Helper::get_upload_folder() . 'almera' . '/demo_db.sql'); if (!$wp_options or !$wp_postmeta or !$demo_db) { _e("Ooops! It seems demo files are missed on the server. Please, make sure the \"uploads\" directory exists in your \"/wp-content\" directory with all the necessary files from theme bundle.", 'almera'); exit; } //*** check for tmm_shortcodes plugin uploading $tmm_shortcodes = ABSPATH . 'wp-content/plugins/tmm_shortcodes'; $tmm_shortcodes = is_dir($tmm_shortcodes); if (!$tmm_shortcodes) { _e("Ooops! You've missed to install the \"tmm_shortcodes\" before demo installation. Please install tmm_shortcodes before doing that. You can find it in theme bundle. ", 'almera'); exit; } //*** DATA BASE IMPORT global $wpdb; $site_url = site_url(); $new_file_path = ABSPATH; //*** $sql_install_data = file_get_contents(TMM_Helper::get_upload_folder() . 'almera' . '/demo_db.sql'); $sql_install_data = str_replace('new_site_url', $site_url, $sql_install_data); $sql_install_data = str_replace('new_file_path', $new_file_path, $sql_install_data); //*** $wpdb->query("DROP TABLE `{$wpdb->commentmeta}`"); $wpdb->query("DROP TABLE `{$wpdb->comments}`"); $wpdb->query("DROP TABLE `{$wpdb->links}`"); $wpdb->query("DROP TABLE `{$wpdb->options}`"); $wpdb->query("DROP TABLE `{$wpdb->postmeta}`"); $wpdb->query("DROP TABLE `{$wpdb->posts}`"); $wpdb->query("DROP TABLE `{$wpdb->terms}`"); $wpdb->query("DROP TABLE `{$wpdb->term_relationships}`"); $wpdb->query("DROP TABLE `{$wpdb->term_taxonomy}`"); $wpdb->query("DROP TABLE `{$wpdb->usermeta}`"); $wpdb->query("DROP TABLE `{$wpdb->users}`"); //*** $sql_install_data = str_replace('wp_commentmeta', $wpdb->commentmeta, $sql_install_data); $sql_install_data = str_replace('wp_comments', $wpdb->comments, $sql_install_data); $sql_install_data = str_replace('wp_layerslider', $wpdb->base_prefix . 'layerslider', $sql_install_data); $sql_install_data = str_replace('wp_links', $wpdb->links, $sql_install_data); $sql_install_data = str_replace('wp_options', $wpdb->options, $sql_install_data); $sql_install_data = str_replace('wp_postmeta', $wpdb->postmeta, $sql_install_data); $sql_install_data = str_replace('wp_posts', $wpdb->posts, $sql_install_data); $sql_install_data = str_replace('wp_revslider_sliders', $wpdb->base_prefix . 'revslider_sliders', $sql_install_data); $sql_install_data = str_replace('wp_terms', $wpdb->terms, $sql_install_data); $sql_install_data = str_replace('wp_term_relationships', $wpdb->term_relationships, $sql_install_data); $sql_install_data = str_replace('wp_term_taxonomy', $wpdb->term_taxonomy, $sql_install_data); $sql_install_data = str_replace('wp_usermeta', $wpdb->usermeta, $sql_install_data); $sql_install_data = str_replace('wp_users', $wpdb->users, $sql_install_data); //*** $sql_install_data = str_replace('wp_user_roles', $wpdb->base_prefix . 'user_roles', $sql_install_data); //*** $sql_install_data = explode('#---TMM_DUMP', $sql_install_data); //*** $sql_install_data = array_map('trim', $sql_install_data); $sql_install_data = array_map('utf8_encode', $sql_install_data); //*** if (!empty($sql_install_data)) { foreach ($sql_install_data as $query) { if (!empty($query)) { $wpdb->query($query); } } } //*** export serialized data from wp_postmeta.dat to wp_postmeta $wp_postmeta_data = file_get_contents(TMM_Helper::get_upload_folder() . 'almera' . '/wp_postmeta.dat'); $wp_postmeta_data = json_decode($wp_postmeta_data, TRUE); if (!empty($wp_postmeta_data)) { $wp_postmeta_data = self::array_value_replace($wp_postmeta_data, 'new_site_url', $site_url); foreach ($wp_postmeta_data as $row_data) { $data = array(); if (is_array($row_data['meta_value'])) { $data = array('meta_id' => $row_data['meta_id'], 'post_id' => $row_data['post_id'], 'meta_key' => $row_data['meta_key'], 'meta_value' => ''); } else { $data = array('meta_id' => $row_data['meta_id'], 'post_id' => $row_data['post_id'], 'meta_key' => $row_data['meta_key'], 'meta_value' => $row_data['meta_value']); } //***** $wpdb->insert($wpdb->postmeta, $data); if (is_array($row_data['meta_value'])) { update_post_meta($row_data['post_id'], $row_data['meta_key'], $row_data['meta_value']); } } } //*** export serialized data from wp_options.dat to wp_postmeta $wp_options_data = file_get_contents(TMM_Helper::get_upload_folder() . 'almera' . '/wp_options.dat'); $wp_options_data = json_decode($wp_options_data, TRUE); if (!empty($wp_options_data)) { $wp_options_data = self::array_value_replace($wp_options_data, 'new_site_url', $site_url); update_option(TMM_THEME_PREFIX . 'theme_options', $wp_options_data); } //*** global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(true); //*** $theme_mods = get_option('theme_mods_' . 'almera'); $theme_mods['nav_menu_locations']['primary'] = 2; update_option('theme_mods_' . 'almera', $theme_mods); //*** //DEMO USER CREATING $userdata['user_login'] = '******'; $userdata['user_pass'] = '******'; $userdata['user_email'] = '*****@*****.**'; $userdata['user_nicename'] = 'demo'; $userdata['role'] = 'administrator'; wp_insert_user($userdata); //*** echo 'succsess'; exit; }
public function enqueue_scripts() { wp_register_script('tmm_addthis_widget', 'http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f3c188f442f3bf2', array(), false, true); global $post; if (get_post_type() === 'post') { $post_pod_type = get_post_meta($post->ID, 'post_pod_type', true); $thumb_src = TMM_Helper::get_post_featured_image($post->ID, '840*500'); if ($post_pod_type === 'video_test') { //todo: share video on facebook in testing mode $post_type_values = get_post_meta(get_the_ID(), 'post_type_values', true); $source_url = $post_type_values['video']; if (!has_post_thumbnail()) { if (strpos($source_url, "youtube.com") !== false || strpos($source_url, "youtu.be") !== false) { if (strpos($source_url, "youtube.com") !== false || strpos($source_url, "youtu.be") !== false) { $video_youtube = explode("?v=", $source_url); } else { $video_youtube = explode("youtu.be/", $source_url); } if (!empty($video_youtube[1])) { $thumb_src = 'http://img.youtube.com/vi/' . $video_youtube[1] . '/default.jpg'; } } else { if (strpos($source_url, "vimeo.com") !== false) { $arr = parse_url($source_url); if (!empty($arr['path'])) { $xml = simplexml_load_file('http://vimeo.com/api/v2/video' . $arr['path'] . '.xml'); if ($xml) { $thumb_src = (string) $xml->video->thumbnail_medium; } } } } } if (!empty($source_url)) { ?> <meta property="og:url" content="<?php the_permalink(); ?> " /> <meta property="og:type" content="article" /> <meta property="og:video" content="<?php echo $source_url; ?> " /> <meta property="og:video:secure_url" content="<?php echo $source_url; ?> " /> <meta property="og:image" content="<?php echo $thumb_src; ?> " /> <?php } } else { if (!has_post_thumbnail()) { if ($post_pod_type === 'gallery') { $post_type_values = get_post_meta(get_the_ID(), 'post_type_values', true); $gall = $post_type_values['gallery']; $thumb_src = $gall[0]; if (is_multisite()) { $path = wp_upload_dir(); $temp = explode('wp-content/uploads', $thumb_src); $thumb_src = $path['baseurl'] . $temp[1]; } } } ?> <meta property="og:url" content="<?php the_permalink(); ?> " /> <meta property="og:type" content="article" /> <meta property="og:image" content="<?php echo $thumb_src; ?> " /> <meta property="og:image:width" content="840" /> <meta property="og:image:height" content="500" /> <?php } } else { if (class_exists('TMM_Ext_PostType_Car') && get_post_type() === TMM_Ext_PostType_Car::$slug) { $thumb_src = tmm_get_car_cover_image($post->ID, 'thumb'); ?> <meta property="og:url" content="<?php the_permalink(); ?> " /> <meta property="og:type" content="article" /> <meta property="og:image" content="<?php echo $thumb_src; ?> " /> <meta property="og:image:width" content="460" /> <meta property="og:image:height" content="290" /> <?php } else { ?> <meta property="og:url" content="<?php the_permalink(); ?> " /> <meta property="og:title" content="<?php the_title(); ?> " /> <meta property="og:description" content="<?php the_excerpt(); ?> " /> <?php } } }
plus-icon animTop" title="<?php echo $t = TMM::get_option('hide_image_titles') == '0' ? $t : ''; ?> " href="<?php echo get_grid_image_url($images[$i], true); ?> " data-fancybox-group="grid"> <img <?php if ($slideup == '1') { ?> class="slideup" <?php } ?> src="<?php echo TMM_Helper::resize_image($th_url, '995*995'); ?> " alt=""> </a> <a href="<?php echo $title_href = !empty($images[$i]['title_href']) ? $images[$i]['title_href'] : get_permalink($images[$i]['id']); ?> " class="gr-caption"> <?php if (!empty($title)) { ?> <?php foreach ($title as $kk => $value) { ?>
function ajax_load_gall_bycat() { $cat_id = $_POST['cat_id']; $current_page = $_POST['page']; $post_per_page = $_POST['post_per_page']; $layout = $_POST['layout']; if ($cat_id == 'all') { $query = new WP_Query('post_type=gall&posts_per_page=-1'); } else { $query = new WP_Query('post_type=gall&gallery_categories=' . $cat_id); } $images = array(); ob_start(); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); global $post; $tmp = get_post_meta($post->ID, 'thememakers_gallery', true); if (!empty($tmp)) { foreach ($tmp as $key => $value) { $tmp[$key]['post_id'] = $post->ID; } $images = $images + $tmp; } else { $tmp = array(); } } } $images = $images + $tmp; $title_array = array(); if (!empty($images)) { foreach ($images as $key => $value) { if (!isset($title_array[$value['post_id']])) { $title_array[$value['post_id']] = array(); $title_array[$value['post_id']]['title'] = get_the_title($value['post_id']); $title_array[$value['post_id']]['permalink'] = get_permalink($value['post_id']); } } } $i = 1; foreach ($images as $key => $value) { $images[$key]['key'] = $i; $i++; } $img_terms = array(); $img_t = get_terms('gallery_categories', array('hide_empty' => false)); if (!empty($img_t)) { foreach ($img_t as $value) { $img_terms[$value->term_id]['slug'] = $value->slug; $img_terms[$value->term_id]['name'] = $value->name; } } $uniq_id = 0; ?> <section id="gallery-items" data-listing-page-id="<?php echo get_the_ID(); ?> " class="gallery-items clearfix" data-pagination="2" > <?php foreach ($images as $img) { ?> <?php if ($img['key'] > $post_per_page * $current_page - $post_per_page && $img['key'] <= $post_per_page * $current_page) { ?> <?php if ($layout == 3) { ?> <article class="one-third column" data-categories="<?php echo $cat_id; ?> "> <div class="project-thumb"> <a href="<?php echo $img['imgurl']; ?> " class="single-image plus-icon animTop" title="<?php echo $img['title']; ?> " data-fancybox-group="gallery"> <img alt="" src="<?php echo TMM_Helper::resize_image($img['imgurl'], '420*300'); ?> "> </a> <a href="<?php echo $title_array[$img['post_id']]['permalink']; ?> " class="project-meta"> <h6 class="title"><?php echo $img['title']; ?> </h6> <span class="categories"><?php echo $img_terms[$img['category']]['name']; ?> </span> </a> </div><!--/ .project-thumb--> </article> <!--/ .column--> <?php } else { if ($layout == 4) { ?> <article class="four columns" data-categories="<?php echo $cat_id; ?> "> <div class="project-thumb"> <a href="<?php echo $img['imgurl']; ?> " class="single-image plus-icon animTop" title="<?php echo $img['title']; ?> " data-fancybox-group="gallery"> <img alt="" src="<?php echo TMM_Helper::resize_image($img['imgurl'], '420*300'); ?> "> </a> <a href="<?php echo $title_array[$img['post_id']]['permalink']; ?> " class="project-meta"> <h6 class="title"><?php echo $img['title']; ?> </h6> <span class="categories"><?php echo $img_terms[$img['category']]['name']; ?> </span> </a> </div><!--/ .project-thumb--> </article><!--/ .column--> <?php } } ?> <?php $uniq_id = $uniq_id + $img['key'] + $img['post_id'] + $img['category'] + '_' . $cat_id; ?> <?php } ?> <?php } ?> <?php if ($post_per_page < count($images)) { $page_count = ceil(count($images) / $post_per_page); $t = 1; if ($current_page != 1 && $current_page != $page_count + 1) { $t = 1; } ?> <div class="wp-pagenavi gall"> <?php for ($i = 1; $i <= $page_count + $t; $i++) { if ($page_count == $current_page) { if ($i == 1) { ?> <li><a class="prev page-numbers" data-categories="<?php echo $cat_id; ?> " data-post-per-page="<?php echo $post_per_page; ?> " data-page-namber="<?php echo $current_page - 1; ?> " href="#"></a></li> <?php } else { if ($i == $page_count + $t) { ?> <span class="page-numbers current"><?php echo $current_page; ?> </span> <?php } else { ?> <li><a class="page-numbers" data-categories="<?php echo $cat_id; ?> " data-post-per-page="<?php echo $post_per_page; ?> " data-page-namber="<?php echo $i - 1; ?> " href="#"><?php echo $i - 1; ?> </a></li> <?php } } } else { if ($i == 1) { if ($current_page == $i) { ?> <span class="page-numbers current"><?php echo $current_page; ?> </span> <?php } else { ?> <li><a class="prev page-numbers" data-categories="<?php echo $cat_id; ?> " data-post-per-page="<?php echo $post_per_page; ?> " data-page-namber="<?php echo $current_page - 1; ?> " href="#"></a></li> <?php } } else { if ($i == $page_count + $t) { if ($current_page == $i - $t) { ?> <span class="page-numbers current"><?php echo $current_page; ?> </span> <?php } else { ?> <li><a class="next page-numbers" data-categories="<?php echo $cat_id; ?> " data-post-per-page="<?php echo $post_per_page; ?> " data-page-namber="<?php echo $current_page + 1; ?> " href="#"></a></li> <?php } ?> <?php } else { if ($current_page == $i) { ?> <span class="page-numbers current"><?php echo $current_page; ?> </span> <?php } else { ?> <li><a class="page-numbers" data-categories="<?php echo $cat_id; ?> " data-post-per-page="<?php echo $post_per_page; ?> " data-page-namber="<?php echo $i; ?> " href="#"><?php echo $i; ?> </a></li> <?php } ?> <?php } } } } ?> </div> <?php } ?> <input type="hidden" id="uniq_id" data-uniq-id="<?php echo $uniq_id; ?> "> </section> <?php $response = ob_get_contents(); ob_end_clean(); echo $response; die; }
<?php } ?> </ul><!--/ #portfolio-items--> </section><!--/ .section--> <?php if ($w_query->max_num_pages > 1) { ?> <div class="pagenavi align-center"> <?php $folio_onepage = TMM_Helper::get_folio_onepage(); $str = explode('#', $folio_onepage); $str = $str['1']; $permalink = get_permalink($current_page_id); $pos = strpos($permalink, '?'); $permalink = $pos === false ? $permalink . '?' : $permalink . '&'; ?> <?php if ($folio_page - 1 > 0) { ?> <a href="<?php echo $permalink; ?> folio_page=<?php echo $folio_page - 1;
<section class="recent-projects"> <?php if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <article class="four columns"> <div class="project-thumb"> <a href="<?php echo TMM_Helper::get_post_featured_image($post->ID, ''); ?> " class="single-image plus-icon animTop" title="" rel="gallery"> <img src="<?php echo TMM_Helper::get_post_featured_image($post->ID, '420*300', true); ?> " alt="<?php the_title(); ?> " /> </a> <a href="<?php the_permalink(); ?> " class="project-meta"> <h5 class="title"><?php the_title(); ?>
public static function change_options() { $action_type = $_REQUEST['type']; $data = array(); parse_str($_REQUEST['values'], $data); $data = TMM_Helper::db_quotes_shield($data); switch ($action_type) { case 'save': if (!empty($data)) { foreach ($data as $option => $newvalue) { if ($option == "sidebars") { unset($newvalue[0]); TMM::update_option('sidebars', $newvalue); continue; } if ($option == "seo_group") { unset($newvalue[0]); TMM::update_option('seo_groups', $newvalue); continue; } if ($option == "contact_form") { if (!empty($newvalue)) { foreach ($newvalue as $key => $form) { if (!isset($newvalue[$key]['title'])) { unset($newvalue[$key]); } if (empty($newvalue[$key]['title'])) { unset($newvalue[$key]); } } } TMM_Contact_Form::save($newvalue); continue; } if (is_array($newvalue)) { self::update_option($option, $newvalue); } else { $newvalue = stripcslashes($newvalue); $newvalue = str_replace('\\"', '"', $newvalue); $newvalue = str_replace("\\'", "'", $newvalue); self::update_option($option, $newvalue); } } } _e('Options have been updated.', 'almera'); break; case 'reset': if (!empty($data)) { foreach ($data as $option => $newvalue) { if ($option == "sidebars") { continue; } if ($option == "contact_form") { continue; } self::update_option($option, $newvalue); } } _e('Options have been reset.', 'almera'); break; default: break; } //**** CSS REGENERATION $custom_css1 = self::draw_free_page(TMM_THEME_PATH . '/admin/theme_options/custom_css1.php'); $custom_css2 = self::draw_free_page(TMM_THEME_PATH . '/admin/theme_options/custom_css2.php'); $handle = fopen(TMM_THEME_PATH . '/css/custom1.css', 'w'); fwrite($handle, $custom_css1); fclose($handle); $handle = fopen(TMM_THEME_PATH . '/css/custom2.css', 'w'); fwrite($handle, $custom_css2); fclose($handle); exit; }
$unique_id = uniqid(); $google_fonts = TMM_HelperFonts::get_google_fonts(); $content_fonts = TMM_HelperFonts::get_content_fonts(); $fonts = array_merge($content_fonts, $google_fonts); $fonts = array_merge(array("" => ""), $fonts); ?> <div class="slide-item" id="slide_item_<?php echo $unique_id; ?> "> <div class="slide-dragger"></div> <div class="slide-thumb"> <img src="<?php echo TMM_Helper::resize_image($group['imgurl'], '155*55'); ?> " alt="slide" /> <input type="hidden" name="slides_group[<?php echo $unique_id; ?> ][imgurl]" value="<?php echo $group['imgurl']; ?> " /> <a href="#" class="button js_edit_slide" data-slide-id="<?php echo $unique_id; ?> "><?php _e('Edit Image', 'almera'); ?>
public static function show_edit_columns_content($column) { global $post; switch ($column) { case "image": echo '<div style="width:400px;">'; echo '<img alt="" src="' . TMM_Helper::get_post_featured_image($post->ID, '200*200', true) . '"/>'; echo '</div>'; break; case "description": the_excerpt(); break; case "tags": echo get_the_tag_list('', '', '', $post->ID); break; case "foliocat": echo get_the_term_list($post->ID, 'foliocat', '', ', ', ''); break; } }
<img src="<?php echo TMM_Helper::get_post_featured_image($post_id, '560*390'); ?> " alt="<?php echo $post->post_title; ?> " /> <div class="image-extra"> <div class="extra-content"> <div class="inner-extra"> <a class="single-image link-icon" href="<?php echo $post_link; ?> "></a> <a class="single-image plus-icon" data-fancybox-group="blog" href="<?php echo TMM_Helper::get_post_featured_image($post_id, ''); ?> "></a> </div><!--/ .inner-extra--> </div><!--/ .extra-content--> </div><!--/ .image-extra--> </div><!--/ .work-item--> </div><!--/ .entry-image--> <?php } ?> <?php break; } }
} ?> <div id="tmm_shortcode_template" class="tmm_shortcode_template clearfix"> <div class="one-half"> <?php TMM_Ext_Shortcodes::draw_shortcode_option(array('type' => 'select', 'title' => __('Category', 'tmm_shortcodes'), 'shortcode_field' => 'category', 'id' => 'category', 'options' => TMM_Helper::get_post_categories(), 'default_value' => TMM_Ext_Shortcodes::set_default_value('category', ''), 'description' => '')); ?> </div><!--/ .ona-half--> <div class="one-half"> <?php TMM_Ext_Shortcodes::draw_shortcode_option(array('type' => 'select', 'title' => __('Order By', 'tmm_shortcodes'), 'shortcode_field' => 'orderby', 'id' => 'orderby', 'options' => TMM_Helper::get_post_sort_array(), 'default_value' => TMM_Ext_Shortcodes::set_default_value('orderby', ''), 'description' => '')); ?> </div><!--/ .ona-half--> <div class="one-half"> <?php TMM_Ext_Shortcodes::draw_shortcode_option(array('type' => 'checkbox', 'title' => __('Meta Data', 'tmm_shortcodes'), 'shortcode_field' => 'show_metadata', 'id' => 'show_metadata', 'is_checked' => TMM_Ext_Shortcodes::set_default_value('show_metadata', 1), 'description' => __('Show/Hide Meta Info', 'tmm_shortcodes'))); ?> </div> <div class="one-half"> <?php TMM_Ext_Shortcodes::draw_shortcode_option(array('type' => 'select', 'title' => __('Order', 'tmm_shortcodes'), 'shortcode_field' => 'order', 'id' => 'order', 'options' => array('DESC' => __('DESC', 'tmm_shortcodes'), 'ASC' => __('ASC', 'tmm_shortcodes')), 'default_value' => TMM_Ext_Shortcodes::set_default_value('order', 'DESC'), 'description' => ''));
$cats = get_terms('foliocat', array('hide_empty' => false)); if (!isset($categories)) { $categories = ""; } $categories = explode(',', $categories); //*** $categoryHierarchy = array(); TMM_Helper::sort_terms_hierarchicaly($cats, $categoryHierarchy); ?> <?php if (!empty($categoryHierarchy)) { ?> <ul class="tmm_portfolio_item_cats"> <?php TMM_Helper::draw_cats_checkbox_options($categoryHierarchy, $categories, 0); ?> </ul> <?php } ?> </div> <a href="javascript:jQuery('#additional_folio_item_options').toggle();void(0);">[+] <?php _e("Additional options", 'almera'); ?> </a><br /> <br />