Jun 12, 2019 TemplateToaster is a powerful application especially created to help you design themes for WordPress, Drupal, Magento and Joomla, as well as for HTML5 and CSS3 based websites. Comprehensive work.
- /**
- * TemplateToaster functions and definitions
- * @package templatetoaster
- require_once 'inc/shortcodes.php';
- ob_start();
- global $templatetoaster_classes_post, $templatetoaster_cssprefix, $templatetoaster_theme_widget_args;
- 'ttr_post'
- * TemplateToaster functions and definitions
- * Sets up the theme and provides some helper functions. Some helper functions
- * are used in the theme as custom template tags. Others are attached to action and
- * filter hooks in WordPress to change core functionality.
- * The first function, templatetoaster_theme_setup(), sets up the theme by registering support
- * for various features in WordPress, such as post thumbnails, navigation menus, and the like.
- * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
- * to a filter or action hook. The hook can be removed by using remove_action() or
- * remove_filter() and you can attach your own function to the hook.
- * We can remove the parent theme's hook only after it is attached, which means we need to
- *
- * add_action( 'after_setup_theme', 'my_child_templatetoaster_theme_setup' );
- * function my_child_templatetoaster_theme_setup() {
- * }
- *
- /**
- * Set the content width based on the theme's design and stylesheet.
- global $templatetoaster_theme_widget_args;
- if (!isset($content_width))
- * Tell WordPress to run templatetoaster_theme_setup() when the 'after_setup_theme' hook is run.
- if (!function_exists('templatetoaster_setup')) :
- /**
- * Sets up theme defaults and registers support for various WordPress features.
- * Note that this function is hooked into the after_setup_theme hook, which
- * runs before the init hook. The init hook is too late for some features, such
- */
- * Make theme available for translation.
- * Translations can be filed in the /languages/ directory.
- * If you're building a theme based on templatetoaster, use a find and replace
- * to change 'templatetoaster' to the name of your theme in all the template files
- load_theme_textdomain('TemplateToaster', get_template_directory() . '/languages');
- require_once(get_template_directory() . '/theme-options.php');
- global $templatetoaster_options, $templatetoaster_cssprefix, $templatetoaster_classes_post;
- $templatetoaster_options = get_option('templatetoaster_theme_options');
- $seomode = templatetoaster_theme_option('ttr_seo_enable');
- add_filter('wp_title', 'templatetoaster_wp_title', 10, 2);
- add_theme_support('title-tag');
- require_once(get_template_directory() . '/widgetinit.php');
- require_once(get_template_directory() . '/custommenu.php');
- require_once(get_template_directory() . '/loginform.php');
- require_once(get_template_directory() . '/shortcodes.php');
- if (extension_loaded('zip')) {
- }
- $templatetoaster_cssprefix . 'post'
- $fileName = get_template_directory() . '/content/imports.php';
- add_action('admin_notices', 'my_admin_notice');
- // include 'tt_editor.php';
- // This theme styles the visual editor with editor-style.css to match the theme style.
- // Load up our theme options page and related code.
- // Add default posts and comments RSS feed links to <head>.
- * Enable support for Post Thumbnails on posts and pages.
- * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
- add_theme_support('post-thumbnails');
- register_nav_menus(array(
- ));
- // Add support for a variety of post formats
- add_theme_support('post-formats', array(
- 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
- add_filter('use_default_gallery_style', '__return_false');
- // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
- 'wheel' => array(
- 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
- 'description' => __('Wheel', 'TemplateToaster')
- 'shore' => array(
- 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
- 'description' => __('Shore', 'TemplateToaster')
- 'trolley' => array(
- 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
- 'description' => __('Trolley', 'TemplateToaster')
- 'pine-cone' => array(
- 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
- 'description' => __('Pine Cone', 'TemplateToaster')
- 'chessboard' => array(
- 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
- 'description' => __('Chessboard', 'TemplateToaster')
- 'lanterns' => array(
- 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
- 'description' => __('Lanterns', 'TemplateToaster')
- 'willow' => array(
- 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
- 'description' => __('Willow', 'TemplateToaster')
- 'hanoi' => array(
- 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
- 'description' => __('Hanoi Plant', 'TemplateToaster')
- ));
- add_action('after_setup_theme', 'templatetoaster_setup');
- function my_admin_notice() {
- <form method='post'>
- <?php _e('Import website content?     ', 'TemplateToaster'); ?>
- <input type='submit' value=' Yes ' name='importt'>
- </form>
- }
- $fileName = get_template_directory() . '/content/imports.php';
- if (file_exists($fileName) && isset($_POST['importt'])) {
- require_once(get_template_directory() . '/content/imports.php');
- }
- echo '<div> <p>';
- echo'</p></div>';
- } else {
- _e('Content Not Imported Sucessfully, Reactivate and import it again', 'TemplateToaster');
- $imported = false;
- }
- function templatetoaster_excerpt_length($length) {
- }
- add_filter('excerpt_length', 'templatetoaster_excerpt_length');
- /**
- */
- function templatetoaster_continue_reading_link() {
- if (templatetoaster_theme_option('ttr_read_more_button')) {
- return '<br/><br/><a href=' . esc_url(get_permalink()) . '>' . '<span>' . __(templatetoaster_theme_option('ttr_read_more'), 'TemplateToaster') . '<span>→</span></span>' . '</a>';
- return '<br/><br/><a href=' . esc_url(get_permalink()) . '>' . __(templatetoaster_theme_option('ttr_read_more'), 'TemplateToaster') . '<span>→</span></a>';
- }
- /**
- * Replaces '[...]' (appended to automatically generated excerpts) with an ellipsis and templatetoaster_continue_reading_link().
- * To override this in a child theme, remove the filter and add your own
- */
- function templatetoaster_auto_excerpt_more($more) {
- return ' …' . templatetoaster_continue_reading_link();
- add_filter('excerpt_more', 'templatetoaster_auto_excerpt_more');
- /**
- */
- function templatetoaster_trim_words($text, $more = null, $t) {
- $num_words = templatetoaster_theme_option('ttr_read_length');
- $more = '…';
- $text = preg_replace('/<img[^>]+>/i', ', $text);
- /* translators: If your word count is based on single characters (East Asian characters),
- enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
- if ('characters' _x('words', 'word count: words or characters?', 'TemplateToaster') && preg_match('/^utf-?8$/i', get_option('blog_charset'))) {
- $text = trim(preg_replace('/[nrt ]+/', ' ', $text), ' ');
- $words_array = array_slice($words_array[0], 0, $num_words + 1);
- } else {
- $words_array = preg_split('/[nrt ]+/', $text, $num_words + 1, PREG_SPLIT_NO_EMPTY);
- }
- array_pop($words_array);
- $text = $t . $text . $more;
- $text = implode($sep, $words_array);
- }
- /**
- * Read more link function on enabling the tag in theme options
- function templatetoaster_content_filter($content) {
- $t = ';
- preg_match_all($searchimages, $content, $pics);
- if (is_array($pics) && is_array($pics[0]) && !empty($pics[0])) {
- $t = $temp[0];
- $postid = ( isset($post->ID) ? get_the_ID() : NULL );
- $img = '<a href=' . get_permalink($postid) . '>' . $t . '</a>';
- $morelink = ' …' . templatetoaster_continue_reading_link();
- if (templatetoaster_theme_option('ttr_post1_enable') && !is_single() && !is_page() && empty($post->post_excerpt) && !is_feed()) {
- return templatetoaster_trim_words($content, $more = $morelink, $img);
- } else if (!empty($post->post_excerpt) && !is_single() && !is_page() && templatetoaster_theme_option('ttr_post1_enable') && !is_feed()) {
- return $img . '<p>' . $post->post_excerpt . $morelink . '</p>';
- return $content;
- }
- add_filter('the_content', 'templatetoaster_content_filter');
- /**
- * Adds a pretty 'Continue Reading' link to custom post excerpts.
- * To override this link in a child theme, remove the filter and add your own
- * function tied to the get_the_excerpt filter hook.
- function templatetoaster_custom_excerpt_more($output) {
- $output .= templatetoaster_continue_reading_link();
- return $output;
- add_filter('get_the_excerpt', 'templatetoaster_custom_excerpt_more');
- /**
- * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
- function templatetoaster_page_menu_args($args) {
- return $args;
- add_filter('wp_page_menu_args', 'templatetoaster_page_menu_args');
- /**
- * Display navigation to next/previous pages when applicable
- function templatetoaster_content_nav($nav_id) {
- ?>
- <?php echo esc_attr($nav_id); ?>'>
- <?php if (templatetoaster_theme_option('ttr_post_navigation')): ?>
- <?php echo(__('Navigation', 'TemplateToaster')); ?>
- <?php endif; ?>
- <?php
- if (templatetoaster_theme_option('ttr_pagination_link_posts')) {
- $pge = paginate_links(array(
- 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
- 'format' => '?paged=%#%',
- 'prev_text' => __('Previous', 'TemplateToaster'),
- 'current' => max(1, get_query_var('paged')),
- 'total' => $wp_query->max_num_pages
- if ($wp_query->max_num_pages > 1) :
- <ul>
- foreach ($pge as $page) {
- echo '<li>' . $page . '</li>';
- echo '<li>' . $page . '</li>';
- }
- </ul>
- <?php
- if (templatetoaster_theme_option('ttr_older_newer_posts')) {
- <div
- <?php next_posts_link(__('<span>←</span> Older posts', 'TemplateToaster')); ?>
- <div
- <?php previous_posts_link(__('Newer posts <span>→</span>', 'TemplateToaster')); ?>
- <?php } ?>
- <!-- #nav-above -->
- endif;
- * Return the URL for the first link found in the post content.
- * @return string|bool URL or false when no link is present.
- function templatetoaster_url_grabber() {
- if (!preg_match('/<as[^>]*?href=['](.+?)[']/is', get_the_content(), $matches))
- }
- /**
- * Count the number of footer sidebars to enable dynamic classes for the footer
- function templatetoaster_footer_sidebar_class() {
- $count++;
- if (is_active_sidebar('sidebar-4'))
- $count++;
- $class = ';
- switch ($count) {
- $class = 'one';
- case '2':
- break;
- $class = 'three';
- }
- if ($class)
- }
- if (!function_exists('templatetoaster_comment')) :
- /**
- *
- * To override this walker in a child theme without modifying the comments template
- * simply create your own templatetoaster_comment(), and that function will be used instead.
- function templatetoaster_comment($comment, $args, $depth) {
- if (is_singular() && comments_open() && get_option('thread_comments'))
- $GLOBALS['comment'] = $comment;
- case 'pingback' :
- ?>
- <p>
- <?php comment_author_link(); ?>
- <?php edit_comment_link(__('Edit', 'TemplateToaster'), '<span>', '</span>'); ?>
- <?php
- default :
- <li <?php comment_class(); ?>>
- <!--<div>-->
- <?php
- if ('0' != $comment->comment_parent)
- /* translators: 1: comment author, 2: date and time */
- printf(__('%1$s on %2$s <span>said:</span>', 'TemplateToaster'), sprintf('<span>%s</span>', get_comment_author_link()), sprintf('<a href='%1$s'><time datetime='%2$s'>%3$s</time></a>', esc_url(get_comment_link($comment->comment_ID)), get_comment_time('c'),
- /* translators: 1: date, 2: time */ sprintf(__('%1$s at %2$s', 'TemplateToaster'), get_comment_date(), get_comment_time())
- );
- <?php edit_comment_link(__('Edit', 'TemplateToaster'), '<span>', '</span>'); ?>
- <!-- .comment-author .vcard -->
- <?php if ($comment->comment_approved '0') : ?>
- <?php _e('Your comment is awaiting moderation.', 'TemplateToaster'); ?>
- <br/>
- <!--
- <?php comment_text(); ?>
- <?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply <span>↓</span>', 'TemplateToaster'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
- <!-- .reply -->
- <!-- #comment-## -->
- <?php
- endswitch;
- endif; // ends check for templatetoaster_comment()
- if (!function_exists('templatetoaster_entry_meta')) :
- /**
- * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
- * Create your own templatetoaster_entry_meta() to override in a child theme.
- */
- if (is_sticky() && is_home() && !is_paged())
- echo '<span>' . __('Sticky', 'TemplateToaster') . '</span>';
- if (!has_post_format('link') && 'post' get_post_type())
- // Translators: used between list items, there is a space after the comma.
- $categories_list = get_the_category_list(__(', ', 'TemplateToaster'));
- if (templatetoaster_theme_option('ttr_remove_post_category'))
- echo '<span> ' . $categories_list . ' |</span>';
- endif;
- // Translators: used between list items, there is a space after the comma.
- $tag_list = get_the_tag_list(', __(', ', 'TemplateToaster'));
- echo '<span> |' . $tag_list . '</span>';
- if (!has_post_format(array('chat', 'status', 'aside', 'quote'))):
- printf('<span><a href='%1$s'> %3$s | </a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'TemplateToaster'), get_the_author())), get_the_author()
- }
- }
- endif;
- if (!function_exists('templatetoaster_entry_date')) :
- /**
- * Prints HTML with date information for current post.
- * Create your own templatetoaster_entry_date() to override in a child theme.
- * @param boolean $echo Whether to echo the date. Default true.
- */
- function templatetoaster_entry_date($echo = true) {
- $format_prefix = _x('%1$s on %2$s ', '1: post format name. 2: date', 'TemplateToaster');
- $format_prefix = '%2$s ';
- if (templatetoaster_theme_option('ttr_remove_date')):
- $date = sprintf('<span><a href='%1$s'><time datetime='%3$s'>%4$s</time></a></span>', esc_url(get_permalink()), esc_attr(sprintf(__('Permalink to %s', 'TemplateToaster'), the_title_attribute('echo=0'))), esc_attr(get_the_date('c')), esc_html(sprintf($format_prefix, get_post_format_string(get_post_format()), get_the_date()))
- if (has_post_format(array('chat'))):
- echo $date;
- return $date;
- if ($echo)
- endif;
- endif;
- $content = get_the_content();
- return ($has_url) ? $has_url : apply_filters('the_permalink', get_permalink());
- if (!function_exists('templatetoaster_posted_on')) :
- /**
- * Prints HTML with meta information for the current post-date/time and author.
- * Create your own templatetoaster_posted_on to override in a child theme
- function templatetoaster_posted_on($date, $author) {
- if (isset($_POST[sanitize_key('wp_customize')]) && $_POST[sanitize_key('wp_customize')] 'on'):
- echo '<div>';
- echo '<span></span>';
- echo '<span>' . __('Sticky', 'TemplateToaster') . '</span>';
- if ($date && $author) {
- printf('<span> ' . __(', 'TemplateToaster') . ' </span> <img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/><a href='%1$s'> <time datetime='%3$s'> %4$s </time></a><span class = 'meta'> by </span> <img alt=' . __('author', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> <a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else if ($date && !$author) {
- printf('<span> ' . __(', 'TemplateToaster') . ' </span> <img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/><a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> by </span><a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } elseif (!$date && $author) {
- printf('<span>' . __(', 'TemplateToaster') . ' </span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> by </span><img alt=' . __('author', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> <a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else {
- printf('<span> ' . __(', 'TemplateToaster') . ' </span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> by </span><a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- }
- $var_date = templatetoaster_theme_option('ttr_remove_date');
- $var_author = templatetoaster_theme_option('ttr_remove_author_name');
- if (is_sticky() && is_home() && !is_paged()) {
- echo '<span>' . __('Sticky', 'TemplateToaster') . '</span>';
- if ($date && $author) {
- if ($var_date && $var_author) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/><a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> ' . __('by ', 'TemplateToaster') . ' </span> <img alt=' . __('author ', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> <a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else if ($var_author) {
- printf('<span> ' . __('Posted by', 'TemplateToaster') . '</span> <img alt=' . __('author', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> %1$s', sprintf('<span><a href='%1$s'>%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), get_the_author())
- } else if ($var_date) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span><img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/> <time datetime='%3$s'>%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())
- }
- if ($var_date && $var_author) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/><a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> ' . __('by ', 'TemplateToaster') . '</span><a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else if ($var_author) {
- printf('<span> ' . __('Posted by', 'TemplateToaster') . '</span> %1$s ', sprintf('<span><a href='%1$s'>%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), get_the_author())
- } else if ($var_date) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <img alt=' . __('date', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/datebutton.png'/> <time datetime='%3$s'>%4$s</time></a>', esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())
- }
- if ($var_date && $var_author) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> ' . __('by ', 'TemplateToaster') . ' </span><img alt=' . __('author ', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> <a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else if ($var_author) {
- printf('<span> ' . __('Posted by', 'TemplateToaster') . '</span> <img alt=' . __('author', 'TemplateToaster') . ' src=' . get_template_directory_uri() . '/images/authorbutton.png'/> %1$s ', sprintf('<span><a href='%1$s'>%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), get_the_author())
- } else if ($var_date) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())
- }
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a><span class = 'meta'> ' . __('by ', 'TemplateToaster') . '</span><a href='%5$s'>%7$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), esc_html(get_the_author())
- } else if ($var_author) {
- printf('<span> ' . __('Posted by', 'TemplateToaster') . '</span> %1$s ', sprintf('<span><a href='%1$s'>%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'TemplateToaster'), get_the_author()), get_the_author())
- } else if ($var_date) {
- printf('<span> ' . __(', 'TemplateToaster') . '</span> <a href='%1$s'> <time datetime='%3$s'>%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())
- }
- echo '</div>';
- }
- endif;
- /**
- * The first is if the site has only had one author with published posts.
- * The second is if a singular post being displayed
- function templatetoaster_body_classes($classes) {
- if (!is_multi_author()) {
- }
- if (is_singular() && !is_home() && !is_page_template('showcase.php') && !is_page_template('sidebar-page.php'))
- }
- add_filter('body_class', 'templatetoaster_body_classes');
- function templatetoaster_theme_nav_menu($templatetoaster_cssprefix, $location, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh, $templatetoaster_ocmenu, $menuname = ') {
- if ($menuname ') {
- $menu = NULL;
- $menu = wp_get_nav_menu_object($locations[$location]);
- $menu = wp_get_nav_menu_object($menuname);
- return templatetoaster_generate_menu($templatetoaster_cssprefix, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh, $templatetoaster_ocmenu);
- $menu_items = wp_get_nav_menu_items($menu->term_id);
- if ($menu_item->menu_item_parent != 0)
- $count++;
- $menu_item->classes = empty($menu_item->classes) ? (array) get_post_meta($menu_item->ID, '_menu_item_classes', true) : $menu_item->classes;
- continue;
- $childs = templatetoaster_theme_getsubmenu($menu_items, $menu_item);
- if (!empty($menu_item->url)) {
- if (templatetoaster_theme_curPageURL() $menu_item->url) {
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $menu_item->object_id && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- $target = $menu_item->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- }
- $target = $menu_item->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- }
- if ($count1 != $count) {
- $output .= ('<hr /></a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= '</li>';
- if (templatetoaster_theme_curPageURL() $menu_item->url) {
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $menu_item->object_id && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- if ($shop_page $menu_item->object_id) {
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- }
- $target = $menu_item->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . ' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href=' . $menu_item->url . '><span></span>' . $menu_item->title;
- }
- if ($count1 != $count) {
- $output .= ('<hr /></a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= templatetoaster_generate_level1_custom_children($menu_items, $childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- if (empty($childs)) {
- if (templatetoaster_theme_curPageURL() $menu_item->url) {
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $menu_item->object_id && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- }
- $target = $menu_item->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- }
- if ($count1 != $count) {
- $output .= ('<hr /></a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= '</li>';
- if (templatetoaster_theme_curPageURL() $menu_item->url) {
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $menu_item->object_id && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- $attribute = $menu_item->attr_title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown active'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- }
- $target = $menu_item->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)' target=' . $menu_item->target . '><span></span>' . $menu_item->title;
- $output.='<li ' . $templatetoaster_cssprefix . $mmenu . '_items_parent dropdown'><a href='javascript:void(0)'><span></span>' . $menu_item->title;
- }
- if ($count1 != $count) {
- $output .= ('<hr /></a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= templatetoaster_generate_level1_custom_children($menu_items, $childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- }
- }
- $pageURL = 'http';
- $pageURL .= 's';
- $pageURL .= '://';
- $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
- $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
- return $pageURL;
- function templatetoaster_theme_getsubmenu($menu_items, $parent) {
- $submenu = array(); // all menu items under $menuID
- foreach ($menu_items as $key => $item) {
- }
- return $submenu;
- function templatetoaster_generate_menu($templatetoaster_cssprefix = 'ttr_', $meenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh, $templatetoaster_ocmenu) {
- $output = ';
- $output .= '<li><a href=' . get_home_url(null, '/') . '><span></span>' . __('Home', 'TemplateToaster');
- /* $output .= ('</a><hr />'); */
- if ($templatetoaster_justify) {
- $output .= ('<hr /> </a>');
- $output .= ('</a><hr />');
- } else {
- $output .= '<li><a href=' . get_home_url(null, '/') . '><span></span>' . __('Home', 'TemplateToaster');
- /* $output .= ('</a><hr />'); */
- if ($templatetoaster_justify) {
- $output .= ('<hr /> </a>');
- $output .= ('</a><hr />');
- }
- $pages = get_pages(array('child_of' => 0, 'hierarchical' => 0, 'parent' => 0, 'sort_column' => 'menu_order,post_title'));
- $count = count($pages);
- $count2 = 0;
- if ($pagg->post_parent 0)
- $count2++;
- $count1 = 0;
- foreach ($pages as $key => $pagg) {
- $childs = get_pages(array('child_of' => $pagg->ID, 'hierarchical' => 0, 'parent' => $pagg->ID, 'sort_column' => 'menu_order,post_title'));
- $count1++;
- if (empty($childs)) {
- if (home_url() != untrailingslashit(get_permalink($pagg->ID))) {
- if (get_permalink() get_permalink($pagg->ID)) {
- $output .= '<li><a href=' . get_permalink($pagg->ID) . '><span></span>' . $pagg->post_title;
- /*
- $output .= ('<hr />');
- if ($templatetoaster_justify) {
- $output .= ('<hr /> </a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= '</li>';
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $pagg->ID && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- $output .= '<li><a href=' . get_permalink($pagg->ID) . '><span></span>' . $pagg->post_title;
- /* if ($key != ($count - 1))
- */
- if ($count1 != $count2) {
- $output .= ('<hr /> </a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= '</li>';
- } else {
- $output .= '<li><a href=' . get_permalink($pagg->ID) . '><span></span>' . $pagg->post_title;
- /* if ($key != ($count - 1))
- */
- if ($count1 != $count2) {
- $output .= ('<hr /> </a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= '</li>';
- }
- if (home_url() != untrailingslashit(get_permalink($pagg->ID))) {
- if (get_permalink() get_permalink($pagg->ID)) {
- $output .= '<li><a href=' . get_permalink($pagg->ID) . ' ><span></span>' . $pagg->post_title;
- } else if (function_exists('templatetoaster_woocommerce_get_page_id') && (int) templatetoaster_woocommerce_get_page_id('shop') $pagg->ID && is_shop()) {
- $shop_page = (int) templatetoaster_woocommerce_get_page_id('shop');
- if ($shop_page $pagg->ID) {
- $output .= '<li><a href=' . get_permalink($pagg->ID) . ' ><span></span>' . $pagg->post_title;
- } else {
- $output .= '<li><a href=' . get_permalink($pagg->ID) . ' ><span></span>' . $pagg->post_title;
- }
- /* if ($key != ($count - 1))
- */
- if ($count1 != $count2) {
- $output .= ('<hr /></a>');
- $output .= ('</a><hr />');
- } else {
- }
- $output .= templatetoaster_generate_level1_children($childs, $meenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- }
- function templatetoaster_generate_level1_children($args, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh) {
- $output .= '<ul>';
- if ($templatetoaster_menuh) {
- $output .= '<ul>';
- $output .= '<ul>';
- }
- $count = count($args);
- foreach ($args as $key => $child) {
- $child->classes = empty($child->classes) ? (array) get_post_meta($child->ID, '_menu_item_classes', true) : $child->classes;
- $childs = get_pages(array('child_of' => $child->ID, 'hierarchical' => 0, 'parent' => $child->ID, 'sort_column' => 'menu_order,post_title'));
- if ($templatetoaster_magmenu) {
- $output.= '<li><a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- $output.= '<li><a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- $output .= ('<hr />');
- if ($key != ($count - 1)) {
- }
- $output.= ('</li>');
- $output.='<li>';
- $output.='<a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- $output.='<li><a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- $output .= templatetoaster_generate_level2_children($childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- } else {
- $output .= templatetoaster_generate_level2_children($childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- }
- $output .= '</ul>';
- }
- function templatetoaster_generate_level2_children($args, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh) {
- if ($templatetoaster_magmenu) {
- } elseif ($templatetoaster_menuh) {
- } else {
- $output .= '<ul>';
- } else {
- $output .= '<ul>';
- if ($templatetoaster_vmenuh) {
- } else {
- $output .= '<ul>';
- } else {
- }
- foreach ($args as $key => $child) {
- $child->classes = empty($child->classes) ? (array) get_post_meta($child->ID, '_menu_item_classes', true) : $child->classes;
- $childs = get_pages(array('child_of' => $child->ID, 'hierarchical' => 0, 'parent' => $child->ID, 'sort_column' => 'menu_order,post_title'));
- $output.='<li><a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- } else {
- $output.='<li><a href=' . get_permalink($child->ID) . '><span></span>' . $child->post_title . '</a>';
- $output .= ('<hr />');
- if ($key != ($count - 1)) {
- }
- $output .= templatetoaster_generate_level2_children($childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- $output .= '</ul>';
- }
- function templatetoaster_generate_level1_custom_children($menu_items, $args, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh) {
- $output .= '<ul>';
- if ($templatetoaster_menuh) {
- {
- $output.='<ul>';
- else
- $output.='<ul>';
- $output .= '<ul>';
- $output .= '<ul>';
- }
- $child->classes = empty($child->classes) ? (array) get_post_meta($child->ID, '_menu_item_classes', true) : $child->classes;
- $childs = templatetoaster_theme_getsubmenu($menu_items, $child);
- if ($templatetoaster_magmenu) {
- $target = $child->target;
- if (!empty($target) && !empty($attribute)) {
- $output .= '<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output .= '<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output .= '<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output .= '<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } else {
- $target = $child->target;
- if (!empty($target) && !empty($attribute)) {
- $output .= '<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output .= '<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output .= '<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output .= '<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- }
- $output .= ('<hr />');
- if ($key != ($count - 1)) {
- }
- $output.= '</li>';
- $output.='<li>';
- $target = $child->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output.='<a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- $target = $child->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- $output .= ('<hr />');
- if ($key != ($count - 1)) {
- }
- }
- $output .= templatetoaster_generate_level2_custom_children($menu_items, $childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- } else {
- $output .= templatetoaster_generate_level2_custom_children($menu_items, $childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- }
- $output .= '</ul>';
- }
- function templatetoaster_generate_level2_custom_children($menu_items, $args, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh) {
- $count = count($args);
- if ('menu' $mmenu) {
- $output .= '<ul>';
- $output .= '<ul>';
- $output .= '<ul>';
- } else {
- $output .= '<ul>';
- if ($templatetoaster_vmenuh) {
- } else {
- $output .= '<ul>';
- } else {
- $output .= '<ul>';
- }
- foreach ($args as $key => $child) {
- $child->classes = empty($child->classes) ? (array) get_post_meta($child->ID, '_menu_item_classes', true) : $child->classes;
- $childs = templatetoaster_theme_getsubmenu($menu_items, $child);
- $attribute = $child->attr_title;
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- } else {
- $target = $child->target;
- if (!empty($target) && !empty($attribute)) {
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- } elseif (empty($target) && !empty($attribute)) {
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- } elseif (!empty($target) && empty($attribute)) {
- $output.='<li><a href=' . $child->url . ' target=' . $child->target . '><span></span>' . $child->title . '</a>';
- $output.='<li><a href=' . $child->url . '><span></span>' . $child->title . '</a>';
- if ($templatetoaster_magmenu) {
- } else {
- $output .= ('<hr />');
- }
- $output .= templatetoaster_generate_level2_custom_children($menu_items, $childs, $mmenu, $templatetoaster_magmenu, $templatetoaster_menuh, $templatetoaster_vmenuh);
- }
- $output .= '</ul>';
- }
- /**
- * Prints HTML with meta information for the current post-date/time and author.
- * Create your own templatetoaster_posted_on to override in a child theme
- function templatetoaster_theme_dynamic_sidebar($index) {
- global $wp_registered_sidebars, $wp_registered_widgets, $templatetoaster_cssprefix, $params, $menuclass;
- $heading_tag = templatetoaster_theme_option('ttr_heading_tag_block');
- if (empty($heading_tag) || $heading_tag Null) {
- }
- $heading_tag = 'h1';
- $heading_tag = 'h2';
- $heading_tag = 'h3';
- $heading_tag = 'h4';
- $heading_tag = 'h5';
- $heading_tag = 'h6'; */
- if (is_int($index)) {
- $i = 0;
- $i = 0;
- foreach ((array) $wp_registered_sidebars as $key => $value) {
- $index = $key;
- }
- }
- $templatetoaster_sidebars_widgets = wp_get_sidebars_widgets();
- return false;
- if (empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $templatetoaster_sidebars_widgets) || !is_array($templatetoaster_sidebars_widgets[$index]) || empty($templatetoaster_sidebars_widgets[$index]))
- if (!dynamic_sidebar($index)) {
- }
- foreach ((array) $templatetoaster_sidebars_widgets[$index] as $id) {
- if (empty($wp_registered_widgets[$id]['name']) || is_null($wp_registered_widgets[$id]['name'])) {
- }
- array(array_merge((array) $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']))), (array) $wp_registered_widgets[$id]['params']);
- continue;
- foreach ((array) $wp_registered_widgets[$id]['classname'] as $cn) {
- $classname_ .= '_' . $cn;
- $classname_ .= '_' . get_class($cn);
- $classname_ = ltrim($classname_, '_');
- $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);
- $params = apply_filters('dynamic_sidebar_params', $params);
- $widget = $data[$i];
- $i++;
- if (!is_string($widget) || strlen(str_replace(array(' ', ' ', 'n', 'r', 't'), ', $widget)) 0)
- if (strlen(str_replace(array(' ', ' ', 'n', 'r', 't'), ', $params[0]['before_title'])) 0) {
- $widget = preg_replace('#(').*?(' . $params[0]['after_title'] . ')#', '$1$2', $widget);
- $pos = strpos($widget, $params[0]['after_title']);
- $widget_id = $params[0]['widget_id'];
- $widget_obj = $wp_registered_widgets[$widget_id];
- $widget_opt = get_option($widget_obj['callback'][0]->option_name);
- $widget_num = $widget_obj['params'][0]['number'];
- if (isset($widget_opt[$widget_num]['style'])) {
- } else
- if ($pos FALSE) {
- $widget = str_replace($params[0]['before_widget'], '<div class = ' . $templatetoaster_cssprefix . 'block'> <div></div>
- <div class = ' . $templatetoaster_cssprefix . 'block_without_header'> </div> <div>', $widget);
- $widget = str_replace($params[0]['before_widget'], '<div><div></div> <div>', $widget);
- $params[0]['after_widget'] = str_replace('~tt', ', $params[0]['after_widget']);
- $widget = str_replace($params[0]['after_widget'], '</div></div>', $widget);
- $widget = str_replace($params[0]['after_title'], '</' . $heading_tag . '></div> <div>', $widget);
- $widget = str_replace($params[0]['before_title'], '<' . $heading_tag . '>', $widget);
- $classname_ = ';
- foreach ((array) $wp_registered_widgets[$id]['classname'] as $cn) {
- $classname_ .= '_' . $cn;
- $classname_ .= '_' . get_class($cn);
- $classname_ = ltrim($classname_, '_');
- $widget = str_replace($params[0]['before_widget'], sprintf('<aside>', $id, $classname_), $widget);
- $params[0]['after_widget'] = str_replace('~tt', ', $params[0]['after_widget']);
- $widget = str_replace($params[0]['after_widget'], '</aside>', $widget);
- $widget = str_replace($params[0]['after_title'], '</h3>', $widget);
- $widget = str_replace($params[0]['before_title'], '<h3>', $widget);
- if ($index 'sidebar-1' || $index 'sidebar-2') {
- if ($pos FALSE) {
- $widget = str_replace($params[0]['before_widget'], '<div class = ' . $templatetoaster_cssprefix . 'block'> <div></div>
- <div class = ' . $templatetoaster_cssprefix . 'block_without_header'> </div> <div>', $widget);
- }
- }
- }
- function templatetoaster_theme_comment_form($args = array(), $post_id = null, $templatetoaster_cssprefix = 'ttr_') {
- $post_id = $id;
- $id = $post_id;
- $commenter = wp_get_current_commenter();
- $req = get_option('require_name_email');
- $aria_req = ($req ? ' aria-required='true' : ');
- 'author' => '<p>' . '<label placeholder=' . __('Name', 'TemplateToaster') . ' for='author'> </label> ' . ($req ? '<span>*</span>' : ') . '<br/>' .
- '<input name='author' type='text' value=' . esc_attr($commenter['comment_author']) . ' size='30' . $aria_req . ' /></p>',
- 'email' => '<p><label placeholder=' . __('Email', 'TemplateToaster') . ' for='email'></label> ' . ($req ? '<span>*</span>' : ') . '<br/>' .
- '<input name='email' type='text' value=' . esc_attr($commenter['comment_author_email']) . ' size='30' . $aria_req . ' /></p>',
- 'url' => '<p><label for='url'>' . __('Website', 'TemplateToaster') . '</label>' . '<br/>' .
- '<input name='url' type='text' value=' . esc_attr($commenter['comment_author_url']) . ' size='30' /></p>',
- $required_text = sprintf(' ' . __('Required fields are marked %s', 'TemplateToaster'), '<span>*</span>');
- 'fields' => apply_filters('comment_form_default_fields', $fields),
- 'comment_field' => '<p><label for='comment'>' . _x('Comment', 'noun', 'TemplateToaster') . '</label><textarea name='comment' cols='45' rows='8' aria-required='true'></textarea></p>' . '<br/>',
- 'must_log_in' => '<p>' . sprintf(__('You must be <a href='%s'>logged in</a> to post a comment.', 'TemplateToaster'), wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>',
- 'logged_in_as' => '<p>' . sprintf(__('Logged in as <a href='%1$s'>%2$s</a>. <a href='%3$s'>Log out?</a>', 'TemplateToaster'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>',
- 'comment_notes_before' => '<p>' . __('Your email address will not be published.', 'TemplateToaster') . ($req ? $required_text : ') . '</p>',
- 'comment_notes_after' => '<p>' . sprintf(__('You may use these <abbr>HTML</abbr> tags and attributes: %s', 'TemplateToaster'), ' <code>' . allowed_tags() . '</code>') . '</p>',
- 'id_submit' => 'submit',
- 'title_reply' => __('Leave a Reply', 'TemplateToaster'),
- 'title_reply_to' => __('Leave a Reply to %s', 'TemplateToaster'),
- 'cancel_reply_link' => __('Cancel reply', 'TemplateToaster'),
- 'label_submit' => __('Post Comment', 'TemplateToaster'),
- $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults));
- <?php if (comments_open()) : ?>
- <?php if (templatetoaster_theme_option('ttr_comments_form')): ?>
- <div>
- <div>
- <div>
- <div>
- </div>
- <div>
- <div>
- <div>
- <div>
- <?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?>
- <?php cancel_comment_reply_link($args['cancel_reply_link']); ?>
- </h3>
- <?php if (get_option('comment_registration') && !is_user_logged_in()) : ?>
- <?php do_action('comment_form_must_log_in_after'); ?>
- <form action='<?php echo esc_url(site_url('/wp-comments-post.php')); ?>' method='post'
- <?php do_action('comment_form_top'); ?>
- <?php echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); ?>
- <?php do_action('comment_form_logged_in_after', $commenter, $user_identity); ?>
- <?php echo $args['comment_notes_before']; ?>
- do_action('comment_form_before_fields');
- foreach ((array) $args['fields'] as $name => $field) {
- echo apply_filters('comment_form_field_{$name}', $field) . 'n';
- do_action('comment_form_after_fields');
- <?php endif; ?>
- <?php echo apply_filters('comment_form_field_comment', $args['comment_field']); ?>
- <div>
- <span
- onmouseover='this.className = '<?php echo esc_attr($templatetoaster_cssprefix); ?>button_hover1';'
- onmouseout='this.className = '<?php echo esc_attr($templatetoaster_cssprefix); ?>button';'>
- <input name='ttr_comment_submit' type='submit'
- value='<?php echo esc_attr($args['label_submit']); ?>'/>
- <?php comment_id_fields($post_id); ?>
- <?php do_action('comment_form', $post_id); ?>
- <?php endif; ?>
- </div>
- <div>
- <div>
- <div>
- </div>
- </div>
- <?php do_action('comment_form_after'); ?>
- <?php do_action('comment_form_comments_closed'); ?>
- <?php
- function templatetoaster_count_sidebar_widgets($sidebar_id) {
- if (!isset($the_sidebars[$sidebar_id]))
- else
- }
- function templatetoaster_add_init() {
- wp_enqueue_media(); // enqueue the media js, to be used at upload.js file
- wp_enqueue_style('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/smoothness/jquery-ui.css', false, '1.8.9', false);
- wp_enqueue_style('admin-style', get_template_directory_uri() . '/css/admin-style.css', array(), '1.0.0');
- if ($screen->id 'toplevel_page_mytheme-options') {
- wp_register_script('upload', get_template_directory_uri() . '/js/upload.js', array('jquery', 'media-upload'));
- $tt_upload_data = array('title' => __('Choose or Upload an Image', 'TemplateToaster'), 'text' => __('Use this image', 'TemplateToaster'));
- wp_localize_script('upload', 'tt_upload_data', $tt_upload_data);
- wp_register_script('addtextbox', get_template_directory_uri() . '/js/addtextbox.js', array(), 1.0, false);
- wp_enqueue_script('addtextbox', get_template_directory_uri() . '/js/addtextbox.js', array(), 1.0, false);
- }
- add_action('admin_enqueue_scripts', 'templatetoaster_add_init');
- function templatetoaster_options_setup() {
- if ('media-upload.php' $pagenow || 'async-upload.php' $pagenow) {
- // Now we'll replace the 'Insert into Post Button' inside Thickbox
- add_filter('gettext', 'templatetoaster_replace_thickbox_text', 1, 3);
- }
- add_action('admin_init', 'templatetoaster_options_setup');
- function templatetoaster_replace_thickbox_text($translated_text, $text, $domain) {
- $referer = strpos(wp_get_referer(), 'functions.php');
- return __('Select this image!', 'TemplateToaster');
- }
- }
- function templatetoaster_customAdmin() {
- global $post;
- $postid = ( isset($post->ID) ? get_the_ID() : NULL );
- wp_register_script('togglebutton', get_template_directory_uri() . '/js/jquery.toggle.buttons.js', array('jquery'), '2.8.2', false);
- //wp_register_script('expand', get_template_directory_uri() . '/js/expand.js', array('jquery'), '1.0.0', false);
- wp_register_script('widgetform', get_template_directory_uri() . '/js/widgetform.js', array('jquery'), '1.0.0', false);
- wp_enqueue_script('toggleButtons', get_template_directory_uri() . '/js/toggleButtons.js', array('jquery'), '1.0.0', false);
- $fileName = get_template_directory() . '/content/imports.php';
- $pageClass = get_post_meta($postid, 'tt_pageClass', true);
- $passed_data = array('on' => __('ON', 'TemplateToaster'), 'off' => __('OFF', 'TemplateToaster'), 'pageClass' => $pageClass);
- $passed_data = array('on' => __('ON', 'TemplateToaster'), 'off' => __('OFF', 'TemplateToaster'));
- wp_localize_script('toggleButtons', 'passed_data', $passed_data);
- wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap-admin.css');
- wp_register_style('bootstrap-toggle-buttons', get_template_directory_uri() . '/css/bootstrap-toggle-buttons.css');
- wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), '3.0', false);
- // wp_register_script('jquery_tinymce_script', get_template_directory_uri() . '/js/jquery.tinymce.min.js', array('jquery', 'jquery-ui-core'), '1.2', false);
- wp_register_style('grideditor', get_template_directory_uri() . '/css/grideditor.css');
- }
- add_action('admin_head', 'templatetoaster_customAdmin');
- function templatetoaster_wordpress_breadcrumbs() {
- $name = __('Home', 'TemplateToaster'); //text for the 'Home' link
- $currentAfter = '</span></li>';
- if (!is_home() && !is_front_page() || is_paged()) {
- echo '<ol>';
- global $post;
- echo get_option('ttr_breadcrumb_text');
- echo '<li><a href=' . $home . '>' . $name . '</a></li>';
- if (is_category()) {
- $cat_obj = $wp_query->get_queried_object();
- $thisCat = get_category($thisCat);
- if ($thisCat->parent != 0)
- echo '<li>' . (get_category_parents($parentCat, TRUE, ')) . '</li>';
- echo $currentBefore . __('Archive by category '', 'TemplateToaster');
- echo ''' . $currentAfter;
- echo '<li><a href=' . get_year_link(get_the_time('Y')) . '>' . get_the_time('Y') . '</a></li>';
- echo '<li><a href=' . get_month_link(get_the_time('Y'), get_the_time('m')) . '>' . get_the_time('F') . '</a></li>';
- echo $currentBefore . get_the_time('d') . $currentAfter;
- echo '<li><a href=' . get_year_link(get_the_time('Y')) . '>' . get_the_time('Y') . '</a></li>';
- echo $currentBefore . get_the_time('F') . $currentAfter;
- echo $currentBefore . get_the_time('Y') . $currentAfter;
- $cat = get_the_category();
- $cat = $cat[0];
- echo '<li>' . get_category_parents($cat, TRUE, ') . '</li>';
- the_title();
- }
- echo $currentBefore;
- echo $currentAfter;
- $parent_id = $post->post_parent;
- while ($parent_id) {
- $breadcrumbs[] = '<li><a href=' . get_permalink($page->ID) . '>' . get_the_title($page->ID) . '</a></li>';
- }
- foreach ($breadcrumbs as $crumb)
- echo $currentBefore;
- echo $currentAfter;
- echo $currentBefore . __('Search results for '', 'TemplateToaster') . get_search_query() . ''' . $currentAfter;
- echo $currentBefore . __('Posts tagged '', 'TemplateToaster');
- echo ''' . $currentAfter;
- global $author;
- echo $currentBefore . __('Articles posted by', 'TemplateToaster') . $userdata->display_name . $currentAfter;
- echo $currentBefore . __('Error 404', 'TemplateToaster') . $currentAfter;
- if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
- echo __('Page', 'TemplateToaster') . ' ' . get_query_var('paged');
- if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
- }
- echo '</ol>';
- }
- add_filter('sidebars_widgets', 'templatetoaster_sidebars_widgets');
- add_action('in_widget_form', 'templatetoaster_in_widget_form', 5, 3);
- //Callback function for options update (priority 5, 3 parameters)
- add_filter('widget_update_callback', 'templatetoaster_in_widget_form_update', 5, 3);
- function templatetoaster_sidebars_widgets($sidebars) {
- return $sidebars;
- if ($s 'wp_inactive_widgets' || strpos($s, 'orphaned_widgets') 0 || empty($sidebar)) {
- }
- foreach ($sidebar as $w => $widget) {
- if (!isset($wp_registered_widgets[$widget])) {
- }
- $opts = $wp_registered_widgets[$widget];
- $id_base = is_array($opts['callback']) ? $opts['callback'][0]->id_base : $opts['callback'];
- if (!$id_base) {
- }
- $instance = get_option('widget_' . $id_base);
- if (!$instance || !is_array($instance)) {
- }
- if (isset($instance['_multiwidget']) && $instance['_multiwidget']) {
- if (!isset($instance[$number])) {
- }
- $instance = $instance[$number];
- }
- unset($opts);
- $show = templatetoaster_show_widget($instance);
- if (!$show) {
- }
- unset($widget);
- unset($sidebar);
- }
- function templatetoaster_show_widget($instance) {
- $post_id = $wp_query->get_queried_object_id();
- if (is_home()) {
- $show = isset($instance['page-home']) ? ($instance['page-home']) : false;
- $show = isset($instance['page-front']) ? ($instance['page-front']) : false;
- $show = isset($instance['page-archive']) ? ($instance['page-archive']) : false;
- if (function_exists('get_post_type')) {
- if ($type != 'page' and $type != 'post')
- $show = isset($instance['page-' . $type]) ? ($instance['page-' . $type]) : false;
- $show = isset($instance['page-single']) ? ($instance['page-single']) : false;
- $show = isset($instance['page-404']) ? ($instance['page-404']) : false;
- $show = isset($instance['page-' . $post_id]) ? ($instance['page-' . $post_id]) : false;
- $show = false;
- if ($show)
- }
- function templatetoaster_in_widget_form($t, $return, $instance) {
- $instance = wp_parse_args((array) $instance, array('style' => 'default'));
- 'post_type' => 'page', 'post_status' => 'publish',
- 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC'
- $wp_page_types = array(
- 'home' => __('Blog', 'TemplateToaster'),
- 'single' => __('Single Post', 'TemplateToaster'),
- );
- <br/>
- <?php echo(__('Hide widget on:', 'TemplateToaster')); ?>
- <div>
- <div>
- <button type='button'>
- </button>
- <button type='button'>
- </button>
- foreach ($pages as $page) {
- if ($page->ID ! (int) get_option('page_on_front') && $page->ID ! (int) get_option('page_for_posts')) {
- $instance['page-' . $page->ID] = isset($instance['page-' . $page->ID]) ? $instance['page-' . $page->ID] : false;
- <div>
- <input
- type='checkbox' <?php checked($instance['page-' . $page->ID], true) ?>
- name='<?php echo esc_attr($t->get_field_name('page-' . $page->ID)); ?>'/>
- for='
- <?php echo esc_attr($t->get_field_id('page-' . $page->ID)); ?>'><?php echo $page->post_title ?>
- </div>
- }
- ?>
- foreach ($wp_page_types as $key => $label) {
- $instance['page-' . $key] = isset($instance['page-' . $key]) ? $instance['page-' . $key] : false;
- <div>
- <input
- type='checkbox' <?php checked($instance['page-' . $key], true) ?>
- name='<?php echo esc_attr($t->get_field_name('page-' . $key)); ?>'/>
- for='
- <?php echo esc_attr($t->get_field_id('page-' . $key)); ?>
- '><?php echo $label . ' ' . __('Page', 'TemplateToaster') ?>
- </div>
- <?php
- $instance['style'] = null;
- <?php echo $t->get_field_id('style'); ?>'><?php echo(__('Block Style:', 'TemplateToaster')); ?>
- <select name='<?php echo $t->get_field_name('style'); ?>'>
- <?php selected($instance['style'], 'default'); ?>value='default'><?php echo(__('Default', 'TemplateToaster')); ?>
- <option
- value='none'><?php echo(__('None', 'TemplateToaster')); ?>
- <option
- <?php selected($instance['style'], 'block'); ?>value='block'><?php echo(__('Block', 'TemplateToaster')); ?>
- </select>
- $retrun = null;
- }
- function templatetoaster_in_widget_form_update($instance, $new_instance, $old_instance) {
- 'post_type' => 'page', 'post_status' => 'publish',
- 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC'
- if ($pages) {
- foreach ($pages as $page) {
- if (isset($new_instance['page-' . $page->ID])) {
- } else if (isset($instance['page-' . $page->ID]))
- unset($page);
- }
- foreach (array('front', 'home', 'archive', 'single', '404') as $page) {
- $instance['page-' . $page] = 1;
- unset($instance['page-' . $page]);
- $instance['style'] = $new_instance['style'];
- }
- /**
- * Adds a box to the main column on the Post and Page edit screens.
- function templatetoaster_post_options_array() {
- array('type' => 'open'),
- array('name' => __('Display Post Title', 'TemplateToaster'),
- 'desc' => 'Check this box if you would like to DISABLE the Post Title',
- 'type' => 'checkbox',
- array('name' => __('Enable Post link', 'TemplateToaster'),
- 'desc' => 'Check this box if you would like to ENABLE the 'Post link'.',
- 'type' => 'checkbox',
- array('type' => 'close')
- return $postoptions;
- $pageoptions = array(
- array('name' => __('Display Page Title', 'TemplateToaster'),
- 'desc' => 'Check this box if you would like to DISABLE the Page Title',
- 'type' => 'checkbox',
- array('name' => __('Display Footer', 'TemplateToaster'),
- 'desc' => 'Check this box if you would like to DISABLE the Page Footer',
- 'type' => 'checkbox',
- array('name' => __('Header Background Style', 'TemplateToaster'),
- 'id' => 'ttr_header_size_select',
- 'std' => 'none',
- 'options' => array(__('None', 'TemplateToaster'), __('Fill', 'TemplateToaster'), __('Horizontal Fill', 'TemplateToaster'), __('Vertical Fill', 'TemplateToaster'))),
- array('name' => __('Disable header Image Repeat', 'TemplateToaster'),
- 'desc' => 'Check this box if you dont want to repeat image',
- 'type' => 'checkbox',
- array('name' => __('Header Background Image', 'TemplateToaster'),
- 'id' => 'ttr_change_header_image_text',
- 'std' => '),
- array('name' => __('Body Background Style', 'TemplateToaster'),
- 'desc' => 'Select Box for background Image size',
- 'type' => 'select',
- 'options' => array(__('None', 'TemplateToaster'), __('Fill', 'TemplateToaster'), __('Horizontal Fill', 'TemplateToaster'), __('Vertical Fill', 'TemplateToaster'))),
- array('name' => __('Disable background Image Repeat', 'TemplateToaster'),
- 'desc' => 'Check this box if you dont want to repeat image',
- 'type' => 'checkbox',
- array('name' => __('Body Background Image', 'TemplateToaster'),
- 'id' => 'ttr_custom_style_text',
- 'std' => '),
- );
- }
- function templatetoaster_add_custom_box() {
- $screens = array('post', 'page');
- foreach ($screens as $screen) {
- 'post_page_options', __('Theme Options', 'TemplateToaster'), 'templatetoaster_custombox_in_publish', $screen, 'side', 'high'
- }
- add_action('add_meta_boxes', 'templatetoaster_add_custom_box');
- //Wecraft
- //add_action( 'save_post', 'templatetoaster_save_postdata' );
- function templatetoaster_custombox_in_publish() {
- $postid = ( isset($post->ID) ? get_the_ID() : NULL );
- if (function_exists('templatetoaster_page_options_array'))
- $pageoptions = templatetoaster_page_options_array();
- if (function_exists('templatetoaster_post_options_array'))
- $postoptions = templatetoaster_post_options_array();
- if ('page' != get_post_type($post) && 'post' != get_post_type($post))
- foreach ($pageoptions as $value) {
- ?>
- <?php
- ?>
- <?php
- ?><table>
- <td><h6><?php echo $value['name']; ?></h6></td>
- <td ><select name='<?php echo $value['id']; ?>'><?php foreach ($value['options'] as $option) { ?><option<?php
- if (get_post_meta($postid, $value['id'], true) $option) {
- }
- ?>><?php echo $option; ?></option><?php } ?></select></td>
- break;
- case 'checkbox':
- <tr>
- <?php $var = get_post_meta($postid, $value['id'], true); ?>
- if ((isset($var) && $var 'true') || $var ') {
- } else {
- }
- <div>
- <input type='checkbox' name='<?php echo $value['id']; ?>' <?php echo $checked; ?> />
- </td>
- <?php
- ?>
- <tr>
- <td>
- <input type='text' name='<?php echo $value['id']; ?>' value='<?php
- if (get_post_meta($postid, $value['id'], true) != ') {
- }
- <input type= 'button' name='<?php echo $value['id']; ?>_button' value='Upload' />
- <script type='text/javascript'>
- {
- _orig_send_attachment = wp.media.editor.send.attachment;
- // ADJUST THIS to match the correct button
- {
- var send_attachment_bkp = wp.media.editor.send.attachment;
- var id = button.attr('id').replace('_button', ');
- wp.media.editor.send.attachment = function (props, attachment)
- if (_custom_media)
- jQuery('#' + id).val(attachment.url);
- return _orig_send_attachment.apply(this, [props, attachment]);
- ;
- return false;
- {
- });
- </script>
- </tr>
- <?php
- }
- ?>
- endif;
- foreach ($postoptions as $value) {
- ?>
- <?php
- ?>
- <?php
- ?>
- <td><h6><?php echo $value['name']; ?></h6></td>
- <td ><select name='<?php echo $value['id']; ?>'><?php foreach ($value['options'] as $option) { ?><option<?php
- if (get_post_meta($postid, $value['id'], true) $option) {
- }
- ?>><?php echo $option; ?></option><?php } ?></select></td>
- break;
- case 'checkbox':
- <tr>
- <?php $var = get_post_meta($postid, $value['id'], true); ?>
- if ((isset($var) && $var 'true') || $var ') {
- } else {
- }
- <div>
- <input type='checkbox' name='<?php echo $value['id']; ?>' <?php echo $checked; ?> />
- </td>
- <?php
- }
- ?>
- endif;
- function templatetoaster_save_postdata($post_id) {
- if (function_exists('templatetoaster_page_options_array'))
- $pageoptions = templatetoaster_page_options_array();
- if (function_exists('templatetoaster_post_options_array'))
- $postoptions = templatetoaster_post_options_array();
- return;
- if (defined('DOING_AJAX') && DOING_AJAX)
- if (isset($_POST['post_type']) && 'page' != $_POST['post_type'] && 'post' != $_POST['post_type'])
- if (isset($_POST['post_type']) && 'post' $_POST['post_type']):
- $mydata = $_POST[$value['id']];
- if (strpos($value['id'], 'checkbox') ! false) {
- if (isset($mydata)) {
- } else {
- }
- update_post_meta($post_id, $value['id'], $mydata);
- } elseif (strpos($value['id'], 'text') ! false) {
- update_post_meta($post_id, $value['id'], $mydata);
- }
- if (isset($_POST['post_type']) && 'page' $_POST['post_type']):
- $mydata = $_POST[$value['id']];
- if (strpos($value['id'], 'checkbox') ! false) {
- $mydata = 'true';
- $mydata = 'false';
- update_post_meta($post_id, $value['id'], $mydata);
- } elseif (strpos($value['id'], 'text') ! false) {
- update_post_meta($post_id, $value['id'], $mydata);
- } elseif (strpos($value['id'], 'select') ! false) {
- update_post_meta($post_id, $value['id'], $mydata);
- }
- }
- add_action('wp_head', 'templatetoaster_slide_show');
- function templatetoaster_slide_show() {
- global $templatetoaster_no_slides, $templatetoaster_slide_show_visible, $templatetoaster_cssprefix, $post;
- /* if (function_exists('templatetoaster_slideshow_options_array'))
- $slideshowoptions = templatetoaster_slideshow_options_array();
- $slideshowoptions = '; */
- $tt_options = new Templatetoaster_Theme_Options();
- if ($templatetoaster_slide_show_visible):
- for ($i = 0; $i < $templatetoaster_no_slides; $i++) {
- if (array_key_exists('ttr_slide_show_image' . $i, $slideshowoptions) && $slideshowoptions['ttr_slide_show_image' . $i]['type'] 'media') {
- $slideimage = templatetoaster_theme_option('ttr_slide_show_image' . $i);
- echo '<style>';
- if (templatetoaster_theme_option('ttr_slide_show_image' . $i) && templatetoaster_theme_option('ttr_horizontal_align' . $i) && templatetoaster_theme_option('ttr_vertical_align' . $i) && templatetoaster_theme_option('ttr_stretch' . $i)) {
- $stretch_option = templatetoaster_theme_option('ttr_stretch' . $i);
- if ($stretch_option 'Uniform') {
- } else if ($stretch_option 'Uniform to fill') {
- } else {
- }
- echo '#Slide' . $i . '{background:url(' . templatetoaster_theme_option('ttr_slide_show_image' . $i) . ') no-repeat ' . templatetoaster_theme_option('ttr_horizontal_align' . $i) . ' ' . templatetoaster_theme_option('ttr_vertical_align' . $i) . ' . $stretch . ' !important;}';
- } else if (templatetoaster_theme_option('ttr_slide_show_image' . $i)) {
- echo '#Slide' . $i . '{background:url(' . templatetoaster_theme_option('ttr_slide_show_image' . $i) . ') no-repeat scroll center center / 100% 100% !important;}';
- echo '#Slide' . $i . '{background:url(' . templatetoaster_theme_option('ttr_slide_show_image' . $i) . ') no-repeat scroll center center / 100% 100% ;}';
- echo '</style>';
- }
- }
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title,.' . $templatetoaster_cssprefix . 'post_title a,.' . $templatetoaster_cssprefix . 'post_title a:visited{color:' . get_option('ttr_post_title_color') . ' !important}</style>';
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title a:hover{color:' . get_option('ttr_post_title_hover_color') . ' !important}</style>';
- $postid = ( isset($post->ID) ? get_the_ID() : NULL );
- if (get_post_meta($postid, 'ttr_background_size_select', true)):
- $a = get_post_meta($postid, 'ttr_background_size_select', true);
- case 'Fill':
- if (get_post_meta($postid, 'ttr_custom_style_text', true)):
- echo 'body {';
- echo 'background:url(' . get_post_meta($postid, 'ttr_custom_style_text', true) . ')';
- if (get_post_meta($postid, 'ttr_header_repeat_enable_checkbox', true) 'true')
- else
- echo ' !important;';
- endif;
- if (get_post_meta($postid, 'ttr_custom_style_text', true)):
- echo 'body {';
- echo 'background:url(' . get_post_meta($postid, 'ttr_custom_style_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_header_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- case 'Vertical Fill':
- if (get_post_meta($postid, 'ttr_custom_style_text', true)):
- echo 'body {';
- echo 'background:url(' . get_post_meta($postid, 'ttr_custom_style_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_header_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- default:
- if (get_post_meta($postid, 'ttr_custom_style_text', true)):
- echo 'body {';
- echo 'background:url(' . get_post_meta($postid, 'ttr_custom_style_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_header_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- }
- if (get_post_meta($postid, 'ttr_header_size_select', true)):
- $a = get_post_meta($postid, 'ttr_header_size_select', true);
- case 'Fill':
- if (get_post_meta($postid, 'ttr_change_header_image_text', true)):
- echo 'header{';
- echo 'background:url(' . get_post_meta($postid, 'ttr_change_header_image_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_background_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- case 'Horizontal Fill':
- if (get_post_meta($postid, 'ttr_change_header_image_text', true)):
- echo 'header{';
- echo 'background:url(' . get_post_meta($postid, 'ttr_change_header_image_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_background_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- case 'Vertical Fill':
- if (get_post_meta($postid, 'ttr_change_header_image_text', true)):
- echo 'header{';
- echo 'background:url(' . get_post_meta($postid, 'ttr_change_header_image_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_background_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- default:
- if (get_post_meta($postid, 'ttr_change_header_image_text', true)):
- echo 'header{';
- echo 'background:url(' . get_post_meta($postid, 'ttr_change_header_image_text', true) . ')!important;';
- if (get_post_meta($postid, 'ttr_background_repeat_enable_checkbox', true) 'true')
- echo '}</style>';
- break;
- endif;
- if (templatetoaster_theme_option('ttr_post_title_color')) {
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title,.' . $templatetoaster_cssprefix . 'post_title a,.' . $templatetoaster_cssprefix . 'post_title a:visited{color:' . templatetoaster_theme_option('ttr_post_title_color') . ' !important}</style>';
- if (templatetoaster_theme_option('ttr_post_title_hover_color')) {
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title a:hover{color:' . templatetoaster_theme_option('ttr_post_title_hover_color') . ' !important}</style>';
- if (templatetoaster_theme_option('ttr_logo_image_width') || templatetoaster_theme_option('ttr_logo_image_height')) {
- echo '<style>.' . $templatetoaster_cssprefix . 'header_logo {';
- if (templatetoaster_theme_option('ttr_logo_image_width')) {
- echo 'width:' . templatetoaster_theme_option('ttr_logo_image_width') . 'px !important;';
- if (templatetoaster_theme_option('ttr_logo_image_height')) {
- echo 'height:' . templatetoaster_theme_option('ttr_logo_image_height') . 'px !important;';
- echo '}</style>';
- $delimiter = templatetoaster_theme_option('ttr_breadcrumb_text_separator');
- echo '<style>.breadcrumb > li + li:before
- content: ' . $delimiter . ' !important;
- }
- add_action('wp_head', 'templatetoaster_add_custom_css');
- function templatetoaster_add_custom_css() {
- $post_title_color = templatetoaster_theme_option('ttr_post_title_color');
- $post_title_hover_color = templatetoaster_theme_option('ttr_post_title_hover_color');
- if (($post_title_color != '#') && !empty($post_title_color)) {
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title, .' . $templatetoaster_cssprefix . 'post_title a,.' . $templatetoaster_cssprefix . 'post_title a:visited{color:' . $post_title_color . ' !important}</style>';
- if (($post_title_hover_color != '#') && !empty($post_title_hover_color)) {
- echo '<style>.' . $templatetoaster_cssprefix . 'post_title a:hover{color:' . $post_title_hover_color . ' !important}</style>';
- $tt_custom_css = templatetoaster_theme_option('ttr_custom_style');
- if (isset($tt_custom_css) && !empty($tt_custom_css))
- echo '<style type='text/css'>' . $tt_custom_css . '</style>';
- add_action('wp_footer', 'templatetoaster_add_googleanalytics');
- function templatetoaster_add_googleanalytics() {
- if (templatetoaster_theme_option('ttr_google_analytics_enable')):
- $ga = templatetoaster_theme_option('ttr_google_analytics');
- endif;
- $title = templatetoaster_theme_option('ttr_font_size_title');
- $title_color = templatetoaster_theme_option('ttr_title');
- $slogan = templatetoaster_theme_option('ttr_font_size_slogan');
- $slogan_color = templatetoaster_theme_option('ttr_slogan');
- $block_title = templatetoaster_theme_option('ttr_font_size_block');
- $block_title_color = templatetoaster_theme_option('ttr_blockheading');
- $sidebarmenu_title = templatetoaster_theme_option('ttr_font_size_sidebarmenu');
- $sidebarmenu_title_color = templatetoaster_theme_option('ttr_sidebarmenuheading');
- $copyright = templatetoaster_theme_option('ttr_font_size_copyright');
- $copyright_color = templatetoaster_theme_option('ttr_copyright');
- $designedby = templatetoaster_theme_option('ttr_font_size_designedby');
- $designedby_color = templatetoaster_theme_option('ttr_designedby');
- $designedbylink = templatetoaster_theme_option('ttr_font_size_designedbylink');
- $designedbylink_color = templatetoaster_theme_option('ttr_designedbylink');
- if (!empty($title) || !empty($title_color) || !empty($slogan) || !empty($slogan_color) || !empty($block_title) || !empty($block_title_color) || !empty($sidebarmenu_title) || !empty($sidebarmenu_title_color) || !empty($copyright) || !empty($copyright_color) || !empty($designedby) || !empty($designedby_color) || !empty($designedbylink) || !empty($designedbylink_color)) {
- echo '<style type='text/css'>
- and (min-width : 1025px)
- echo 'header .' . $templatetoaster_cssprefix . 'title_style a, header .' . $templatetoaster_cssprefix . 'title_style a:link, header .' . $templatetoaster_cssprefix . 'title_style a:visited, header .' . $templatetoaster_cssprefix . '_title_style a:hover{
- color:' . $title_color . ';
- }
- if (!empty($slogan) || !empty($slogan_color)) {
- echo '.' . $templatetoaster_cssprefix . 'slogan_style{
- color:' . $slogan_color . ';
- }
- if (!empty($block_title) || !empty($block_title_color)) {
- echo 'h1.' . $templatetoaster_cssprefix . 'block_heading, h2.' . $templatetoaster_cssprefix . 'block_heading, h3.' . $templatetoaster_cssprefix . 'block_heading, h4.' . $templatetoaster_cssprefix . 'block_heading, h5.' . $templatetoaster_cssprefix . 'block_heading, h6.' . $templatetoaster_cssprefix . 'block_heading, p.' . $templatetoaster_cssprefix . 'block_heading{
- color:' . $block_title_color . ';
- }
- if (!empty($sidebarmenu_title) || !empty($sidebarmenu_title_color)) {
- echo 'h1.' . $templatetoaster_cssprefix . 'verticalmenu_heading, h2.' . $templatetoaster_cssprefix . 'verticalmenu_heading, h3.' . $templatetoaster_cssprefix . 'verticalmenu_heading, h4.' . $templatetoaster_cssprefix . 'verticalmenu_heading, h5.' . $templatetoaster_cssprefix . 'verticalmenu_heading, h6.' . $templatetoaster_cssprefix . 'verticalmenu_heading, p.' . $templatetoaster_cssprefix . 'verticalmenu_heading{
- color:' . $sidebarmenu_title_color . ';
- }
- if (!empty($copyright) || !empty($copyright_color)) {
- echo '#' . $templatetoaster_cssprefix . 'copyright a {
- color:' . $copyright_color . ';
- }
- if (!empty($designedby) || !empty($designedby_color)) {
- echo '#' . $templatetoaster_cssprefix . 'footer_designed_by_links{
- color:' . $designedby_color . ';
- }
- if (!empty($designedbylink) || !empty($designedbylink_color)) {
- echo '#' . $templatetoaster_cssprefix . 'footer_designed_by_links a, #' . $templatetoaster_cssprefix . 'footer_designed_by_links a:link, #' . $templatetoaster_cssprefix . 'footer_designed_by_links a:visited, #' . $templatetoaster_cssprefix . 'footer_designed_by_links a:hover{
- color:' . $designedbylink_color . ';
- }
- echo '}
- }
- add_action('template_redirect', 'templatetoaster_m_mode');
- function templatetoaster_m_mode() {
- $mm_mode = templatetoaster_theme_option('ttr_mm_enable');
- if (!is_user_logged_in()) {
- $file = get_template_directory() . '/maintenance-mode.php';
- exit();
- }
- global $templatetoaster_options;
- if (!array_key_exists($option, $templatetoaster_options)) {
- }
- }
- function templatetoaster_unset_options() {
- delete_option('contact_form');
- add_action('switch_theme', 'templatetoaster_unset_options');
- function templatetoaster_wp_title($title, $sep) {
- return $title;
- $title .= get_bloginfo('name', 'display');
- // Add the blog description for the home/front page.
- $site_description = get_bloginfo('description', 'display');
- if ($site_description && (is_home() || is_front_page())) {
- }
- // Add a page number if necessary:
- $title .= ' $sep ' . sprintf(__('Page %s', 'TemplateToaster'), max($paged, $page));
- }
- add_action('wp_head', 'templatetoaster_render_title');
- function templatetoaster_render_title() {
- $seomode = templatetoaster_theme_option('ttr_seo_enable');
- echo '<title>';
- $seo_enable = templatetoaster_theme_option('ttr_seo_rewrite_titles');
- templatetoaster_rewrite_titles();
- templatetoaster_original_titles();
- $google_webmaster = templatetoaster_theme_option('ttr_seo_google_webmaster');
- $bing_webmaster = templatetoaster_theme_option('ttr_seo_bing_webmaster');
- $pinterst_webmaster = templatetoaster_theme_option('ttr_seo_pinterst_webmaster');
- echo sprintf('<meta name='google-site-verification' content='%s'/>n', $google_webmaster);
- echo sprintf('<meta name='msvalidate.01' content='%s'/>n', $bing_webmaster);
- echo sprintf('<meta name='p:domain_verify' content='%s'/>n', $pinterst_webmaster);
- $profile = templatetoaster_theme_option('ttr_seo_google_plus');
- echo '<link href=' . $profile . '/>';
- /* else {
- $profile = templatetoaster_theme_option('googleplus');
- echo '<link href=' . $profile . ' />';
- }
- $blog_title = get_option('blogname');
- $blog_desciprtion = get_option('blogdescription');
- $theme_path_content = get_template_directory_uri() . 'content';
- if (templatetoaster_theme_option('ttr_seo_nonindex_post')) {
- } else {
- }
- if (templatetoaster_theme_option('ttr_seo_nofollow_post')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex-nofollow--><meta name='robots' content='%s, %s'/>n', $noindex, $nofollow);
- if (templatetoaster_theme_option('ttr_seo_nonindex_media')) {
- } else {
- }
- if (templatetoaster_theme_option('ttr_seo_nofollow_media')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex-nofollow--><meta name='robots' content='%s, %s'/>n', $noindex, $nofollow);
- } else if (is_home() || is_page() || is_paged()) {
- if (templatetoaster_theme_option('ttr_seo_nonindex_page')) {
- } else {
- }
- if (templatetoaster_theme_option('ttr_seo_nofollow_page')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex-nofollow--><meta name='robots' content='%s, %s'/>n', $noindex, $nofollow);
- if (templatetoaster_theme_option('ttr_seo_noindex_date_archive')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex--><meta name='robots' content='%s'/>n', $noindex);
- if (templatetoaster_theme_option('ttr_seo_noindex_author_archive')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex--><meta name='robots' content='s'/>n', $noindex);
- if (templatetoaster_theme_option('ttr_seo_noindex_tag_archive')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex--><meta name='robots' content='%s'/>n', $noindex);
- if (is_search()) {
- if (templatetoaster_theme_option('ttr_seo_noindex_search')) {
- } else {
- }
- if (templatetoaster_theme_option('ttr_seo_nofollow_search')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex-nofollow--><meta name='robots' content='%s, %s'/>n', $noindex, $nofollow);
- if (is_category()) {
- if (templatetoaster_theme_option('ttr_seo_noindex_categories')) {
- } else {
- }
- if (templatetoaster_theme_option('ttr_seo_nofollow_categories')) {
- } else {
- }
- echo sprintf('<!--Add by easy-noindex-nofollow--><meta name='robots' content='%s, %s'/>n', $noindex, $nofollow);
- $home_header = templatetoaster_theme_option('ttr_seo_additional_fpage_header');
- $page_header = templatetoaster_theme_option('ttr_seo_additional_post_header');
- $post_header = templatetoaster_theme_option('ttr_seo_additional_page_header');
- echo '<center><h1>' . $home_header . '</h1></center>';
- } else if (is_single() && !empty($page_header)) {
- echo '<center><h1>' . $page_header . '</h1></center>';
- echo '<center><h1>' . $post_header . '</h1></center>';
- }
- add_filter('script_loader_tag', function ($tag, $handle) {
- if (is_admin()) {
- }
- return str_replace(' src', ' defer='defer' src', $tag);
- }, 10, 2); */
- function templatetoaster_comment_call($comment, $args, $depth) {
- ?>
- <li <?php comment_class(); ?>>
- <div>
- <div>
- <?php echo get_avatar($comment, templatetoaster_theme_option('ttr_avatar_size')); ?>
- <div>
- <span><a href='<?php echo esc_url(get_comment_link($comment->comment_ID)) ?>'></a><?php echo get_comment_author_link($comment->comment_ID); ?>
- <time datetime='<?php echo get_comment_date('c') ?>'>
- <a href='<?php echo esc_url(get_comment_link($comment->comment_ID)) ?>'><?php printf(__('%1$s at %2$s', 'TemplateToaster'), get_comment_date(), get_comment_time()) ?></a> </time>
- <?php comment_text() ?>
- <hr>
- <div>
- <span><?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></span>
- <span><?php edit_comment_link(__('(Edit)', 'TemplateToaster')) ?></span>
- <?php if ($comment->comment_approved '0') : ?>
- <br /><em><?php _e('Your comment is awaiting approval.', 'TemplateToaster') ?></em>
- </div>
- <?php echo get_avatar($comment, templatetoaster_theme_option('ttr_avatar_size')); ?>
- <div></div>
- </div>