public function output() { echo $this->element_before(); echo '<div class="cs-inner">'; foreach ($this->field['fields'] as $field) { $field_id = isset($field['id']) ? $field['id'] : ''; $field_value = isset($this->value[$field_id]) ? $this->value[$field_id] : ''; $unique_id = $this->unique . '[' . $this->field['id'] . ']'; if (!empty($this->field['un_array'])) { echo cs_add_element($field, cs_get_option($field_id), $this->unique); } else { echo cs_add_element($field, $field_value, $unique_id); } } echo '</div>'; echo $this->element_after(); }
<div id="infinite-scroll-holder" class="row grid"> <?php //get the nano progga theme settings from Theme Options page. $widgets_positioning = cs_get_option('widgets_positioning'); /* Start the Loop */ $_counter = 0; while (have_posts()) { the_post(); ?> <?php //Determine the pagination $paged = get_query_var('paged') ? get_query_var('paged') : 1; //Show widgets only on the first page or not if (cs_get_option('widgets_in_pages') || 1 === $paged) { //First Widget $widget_1_pos = $widgets_positioning['home_widget_1'] ? (int) $widgets_positioning['home_widget_1'] : 3; if ($_counter === $widget_1_pos && is_active_sidebar('home_widget_1')) { dynamic_sidebar('home_widget_1'); } //Second Widget $widget_2_pos = $widgets_positioning['home_widget_2'] ? (int) $widgets_positioning['home_widget_2'] : 4; if ($_counter === $widget_2_pos && is_active_sidebar('home_widget_2')) { dynamic_sidebar('home_widget_2'); } //Third Widget $widget_3_pos = $widgets_positioning['home_widget_3'] ? (int) $widgets_positioning['home_widget_3'] : 6; if ($_counter === $widget_3_pos && is_active_sidebar('home_widget_3')) { dynamic_sidebar('home_widget_3'); }
<?php global $wd_wt; ?> <footer> <div class="footer-sidebar grey-dark"></div> <div class="footer-bg grey"> <div class="footer-content"> <p><?php echo cs_get_option("wd_copyright"); ?> </p> <p><?php echo cs_get_option("wd_contact_number"); ?> </p> </div> </div> </footer>
<?php global $wd_wt; $title = cs_get_option('wd_newsletter_title'); $logo = cs_get_option('wd_newsletter_logo'); $content = cs_get_option('wd_newsletter_content'); $has_enabled = cs_get_option('wd_enable_newsletter'); ?> <div id="dNewsletter" style="display: none;"> <div class="closeWrap"><a class="closeButton" href="#" onclick="toggle_visibility('dNewsletter');">Close</a></div> <?php if (!empty($logo)) { ?> <img class="newsletterLogo" src="<?php echo $wd_wt->tpl_url['img']; ?> /placeholder.jpe"> <?php } else { ?> <img class="newsletterLogo" src="<?php echo $logo; ?> "/> <?php } ?> <div class="newsletterContent"> <div class="newsletterTitle"><?php
<?php /* Template Name: 留言页面 */ $meta_data = get_post_meta(get_the_ID(), 'message_page', true); $featured = $meta_data['i_page_image']; $wall = cs_get_option('i_comment_wall'); $num = cs_get_option('i_comment_num'); get_header(); ?> <!-- 留言页面 --> <div id="content"> <div class="posts fade out"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <article <?php post_class('post'); ?> > <div class="box-wrap"> <div class="box"> <?php if (!empty($featured)) { ?> <a class="featured-image" href="<?php the_permalink();
<?php /* Template Name: 作品页面 */ $pagination = cs_get_option('i_pagination'); $loadmore = cs_get_option('i_ajax_loading'); $loadend = cs_get_option('i_ajax_end'); $loadnum = cs_get_option('i_ajax_num'); $worksnum = cs_get_option('i_works_num'); ?> <?php get_header(); ?> <div id="content"><div class="posts grid"> <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $show_posts = $worksnum; //How many post you want on per page $permalink = 'Post name'; // Default, Post name $post_type = 'work'; //Know the current URI $req_uri = $_SERVER['REQUEST_URI']; //Permalink set to default if ($permalink == 'Default') { $req_uri = explode('paged=', $req_uri);
function add_js() { echo '<!-- 自定义js --><script>' . cs_get_option('i_js') . '</script>'; }
<?php // 获取选项 $like = cs_get_option('i_post_like'); $qrcodes = cs_get_option('i_code_qrcodes'); $qrcodes_img = cs_get_option('i_qrcodes_img'); $view = cs_get_option('i_post_view'); $meta_data = get_post_meta(get_the_ID(), 'work_options', true); $comment = $meta_data['i_work_comment']; $work_bg = $meta_data['i_work_bg']; $bg_scr = $meta_data['i_work_bg_scr']; $featured = $meta_data['i_work_featured']; $workscom = cs_get_option('i_works_comment'); ?> <?php get_header(); ?> <div id="content"> <div class="posts fadeInDown animated"> <!-- single --> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php setPostViews(get_the_ID()); ?>
<?php // 获取选项 $excerpt = cs_get_option('i_post_readmore'); $qrcodes = cs_get_option('i_code_qrcodes'); $qrcodes_img = cs_get_option('i_qrcodes_img'); $font = cs_get_option('i_post_font'); $view = cs_get_option('i_post_view'); $sticky_img = cs_get_option('i_sticky_image'); $featured = cs_get_option('i_post_featured'); $meta_data = get_post_meta(get_the_ID(), 'aside_options', true); $music = $meta_data['i_post_music']; $player_id = cs_get_option('i_player_id'); $player = cs_get_option('i_player'); $player_mobi = cs_get_option('i_player_mobi'); $author = cs_get_option('i_post_author'); ?> <!-- 日志 --> <div class="box-wrap"> <div class="box"> <header> <?php if (is_single() || is_page()) { ?> <h1 class="entry-title"><a href="<?php the_permalink(); ?> " title="<?php
} ?> </ul> </div> <?php } ?> <footer id="footer"> <?php if ($topbar == true && is_active_sidebar(2) && !is_mobile()) { ?> <?php $column = cs_get_option('i_topbar_col'); $column_style = ''; switch ($column) { case "col_1": $column_style = 'columns1'; break; case "col_2": $column_style = 'columns2'; break; case "col_3": $column_style = 'columns3'; break; case "col_4": $column_style = 'columns4'; break; }
public function csv_import_to_post() { //check if there any errors while uploading $success = true; if (cs_get_option('csv_file')) { //set CSV file $csv_file = array_map('str_getcsv', file(cs_get_option('csv_file'))); $post_meta_order = array_map('trim', current($csv_file)); $post_data = array_values($post_meta_order); $counter_data = 0; $count_data = count($csv_file); $data_per_line = count($post_data); //based on the post meta order that has been set by user $post_data_csv = array(); foreach ($csv_file as $index => $data) { //if option to skip first line is check then will skip the loop if ($index < 1) { continue; } //will iterate every data on CSV file for ($i = 0; $i < $data_per_line; $i++) { $post_data_csv[$post_data[$i]] = $data[$i]; } //will create a post and get id $post_id = wp_insert_post(array('post_title' => $post_data_csv['post_title'] ? $post_data_csv['post_title'] : '', 'post_content' => $post_data_csv['post_content'] ? $post_data_csv['post_content'] : '', 'post_name' => $post_data_csv['post_name'] ? $post_data_csv['post_name'] : '', 'post_type' => cs_get_option('post_type'), 'post_status' => 'publish', 'publish_author' => 1)); if (is_wp_error($post_id)) { echo json_encode(array('success' => 'false', 'message' => $post_id->get_error_message())); } //loop through post meta foreach ($post_data_csv as $meta_key => $meta_value) { if (strstr($meta_key, 'post_')) { continue; } add_post_meta($post_id, $meta_key, $meta_value); } $counter_data++; } //will remove the file from the option if (defined('CS_OPTION')) { $cs_options = get_option(CS_OPTION); unset($cs_options['csv_file']); update_option(CS_OPTION, $cs_options); } echo json_encode(array('success' => 'true', 'message' => __('Successfully Imported CSV', 'import-csv-to-post'))); } die; }
<?php // 获取选项 $excerpt = cs_get_option('i_post_readmore'); $next = cs_get_option('i_post_next'); $author = cs_get_option('i_post_author'); $link = cs_get_option('i_post_link'); $related = cs_get_option('i_post_related'); $mbx = cs_get_option('i_post_mbx'); $like = cs_get_option('i_post_like'); ?> <?php get_header(); ?> <div id="content"> <div class="posts fade out"> <!-- single --> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php setPostViews(get_the_ID()); ?> <article <?php post_class('post'); ?> >
nano_progga_breadcrumbs(); ?> <?php if (cs_get_option('showseriesblog') && is_page_template('page-templates/blog.php') || is_home()) { /** * Featured Series * @since 3.0.0 */ if (cs_get_option('showseries')) { ?> <section id="series-showcase" class="hidden-print"> <?php $series_ids = array(); //default $series_ids = cs_get_option('serieschoice'); if ($series_ids) { ?> <div class="row"> <div class="col-md-12"> <h2 class="inner-title"><span><?php _e('Popular Series', 'nano-progga'); ?> </span></h2> </div> <!-- /.col-md-12 --> <?php foreach ($series_ids as $series_id) { $featured_series = get_term_by('id', (int) $series_id, 'series'); $img_src = nano_get_tax_meta_img_src($series_id, 'series_cover', $size = 'medium'); $series_link = get_term_link((int) $series_id, 'series'); ?>
?> "> <?php echo $ourworkitem["wd_mobile_more_menu_our_work_title"]; ?> </a> <?php } ?> <?php } ?> </div> <div class="nav-bot-wrap"> <?php $menuitems = cs_get_option("wd_mobile_menu_items"); ?> <?php if (isset($menuitems) && !empty($menuitems)) { $i = 1; ?> <?php foreach ($menuitems as $menuitem) { ?> <?php if ($i == 2) { ?> <div class="nav-bot-link" id="ow-link" onclick="toggle_visibility('our-work-menu');"> <script> if (jQuery(window).width() < 767) {
<?php get_template_part('template-parts/content', 'single'); ?> <?php nano_progga_pagination(); ?> <?php /** * Show related posts. * If enabled in Theme Options Page. * ------------------------------------------- */ if (cs_get_option('related_posts')) { echo nano_progga_get_related_posts(get_the_ID()); } ?> <?php // If comments are open or we have at least one comment, load up the comment template. if (comments_open() || get_comments_number()) { comments_template(); } ?> <?php } // End of the loop. ?>
* * @since 3.0.0 * * @param string &$links Links. * -------------------------------------------------------------------------- */ function nano_progga_no_self_ping(&$links) { $home = get_option('home'); foreach ($links as $l => $link) { if (0 === strpos($link, $home)) { unset($links[$l]); } } } if (cs_get_option('noselfping')) { add_action('pre_ping', 'nano_progga_no_self_ping'); } /** * Add Featured Image column to the Post List. * * @since 3.0.0 * * @param array $columns Default columns. * @return array Modified columns. * -------------------------------------------------------------------------- */ function nano_progga_post_thumbnail_columns($columns) { $new_columns = array('thumb' => '<span class="dashicons dashicons-format-image" title="Featured Image"></span>'); return array_merge($columns, $new_columns);
function cs_get_multilang_option($option_name = '', $default = '') { $value = cs_get_option($option_name, $default); $languages = cs_language_defaults(); $default = $languages['default']; $current = $languages['current']; if (is_array($value) && is_array($languages) && isset($value[$current])) { return $value[$current]; } else { if ($default != $current) { return ''; } } return $value; }
/** * The sidebar containing the widget area that is visible only in the archive pages. * * @package nano-progga */ if (!is_active_sidebar('left_sidebar')) { return; } ?> <div id="secondary-left" class="widget-area col-sm-3 pull-left" role="complementary"> <?php // if checked in Theme Options page, then show the author bio on author archives if (cs_get_option('author_bio') && is_author()) { global $authordata; ?> <aside id="author-<?php echo $authordata->ID; ?> " class="widget author-profile vcard"> <?php // avatar $avatar = str_replace("class='avatar", "class='photo avatar alignleft", get_avatar($authordata->user_email, 50)); echo $avatar; // author description $authordesc = $authordata->user_description; echo '<div class="author-desc">'; if (!empty($authordesc)) { echo apply_filters('archive_meta', $authordesc);
} ?> <?php if (is_home() && !is_paged() && !is_mobile()) { ?> <?php if ($bulletin == true) { ?> <div id="bulletin_box"> <i class="fa fa-bell-o"></i> <div id="bulletin"> <?php $my_bulletins = cs_get_option('i_bulletin_custom'); echo '<ul class="bulletin_list">'; if (!empty($my_bulletins)) { foreach ($my_bulletins as $bulletin) { echo '<li>'; if (!empty($bulletin['i_bulletin_link'])) { echo '<a href="' . $bulletin['i_bulletin_link'] . '"'; } if (!empty($bulletin['i_bulletin_link']) && $bulletin['i_bulletin_newtab'] == true) { echo 'target="_black">'; } else { if (!empty($bulletin['i_bulletin_link'])) { echo '>'; } } echo '' . $bulletin['i_bulletin_text'] . '';
<?php if (!empty($social_link)) { ?> <li><a href="<?php echo cs_get_option('social_icon_twitter'); ?> "><img src="<?php echo $wd_wt->tpl_url['assets']; ?> img/social-twitter.png"></a></li> <?php } ?> </ul> <?php $general_contact = cs_get_option('wd-contact-number'); ?> <?php if (!empty($general_contact)) { ?> <p><?php echo $general_contact; ?> </p> <?php } ?> </div> </nav> <a name="1"></a> <section class="sectionOne">
<?php global $wd_wt; ?> <script type="text/javascript"> <?php echo cs_get_option('wd_custom_scripts'); ?> </script> <style type="text/css"> <?php echo cs_get_option('wd_custom_css'); ?> </style> <?php wp_footer(); ?> </body> </html>
</footer><!-- #colophon --> </div><!-- #page --> <!-- SOCIAL LINKS ON THE BOTTOM --> <div class="social-footer-bar hidden-print"> <?php //dynamic values from the Theme Options page. $rss = cs_get_option('rss'); $facebook = cs_get_option('facebook'); $twitter = cs_get_option('twitter'); $linkedin = cs_get_option('linkedin'); $gplus = cs_get_option('googleplus'); $flickr = cs_get_option('flickr'); $pinterest = cs_get_option('pinterest'); $tumblr = cs_get_option('tumblr'); $youtube = cs_get_option('youtube'); ?> <div class="social-handle"><span class="np-toggle"></span></div> <div class="socials"> <?php echo $rss ? '<a href="' . esc_url($rss) . '" class="social-icons s-rss" target="_blank"><span class="np-rss"></span></a>' : ''; echo $facebook ? '<a href="' . esc_url($facebook) . '" class="social-icons s-facebook" target="_blank"><span class="np-facebook"></span></a>' : ''; echo $twitter ? '<a href="' . esc_url($twitter) . '" class="social-icons s-twitter" target="_blank"><span class="np-twitter"></span></a>' : ''; echo $linkedin ? '<a href="' . esc_url($linkedin) . '" class="social-icons s-linkedin" target="_blank"><span class="np-linkedin"></span></a>' : ''; echo $gplus ? '<a href="' . esc_url($gplus) . '" class="social-icons s-gplus" target="_blank"><span class="np-google-plus"></span></a>' : ''; echo $flickr ? '<a href="' . esc_url($flickr) . '" class="social-icons s-flickr" target="_blank"><span class="np-flickr"></span></a>' : ''; echo $pinterest ? '<a href="' . esc_url($pinterest) . '" class="social-icons s-pinterest" target="_blank"><span class="np-pinterest"></span></a>' : ''; echo $tumblr ? '<a href="' . esc_url($tumblr) . '" class="social-icons s-tumblr" target="_blank"><span class="np-tumblr"></span></a>' : ''; echo $youtube ? '<a href="' . esc_url($youtube) . '" class="social-icons s-youtube" target="_blank"><span class="np-youtube"></span></a>' : ''; ?> </div>
if (!empty($social_link)) { ?> <li class="soc-icons"><a class="soc-link" href="<?php echo cs_get_option('social_icon_twitter'); ?> "><img src="<?php echo $wd_wt->tpl_url['assets']; ?> img/social-twitter.png"></a></li> <?php } ?> <li class="stretch"></li> </ul> <?php $general_contact = cs_get_option('wd_contact_number'); ?> <?php if (!empty($general_contact)) { ?> <p class="soc-phone"><?php echo $general_contact; ?> </p> <?php } ?> </div> </nav>
<?php // 获取选项 $excerpt = cs_get_option('i_post_readmore'); ?> <!-- 状态 --> <div class="box-wrap"> <div class="box"> <div class="post-content"> <div class="status-top"></div> <header> <h2 class="entry-title"><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a></h2> </header> <div class="content"> <?php if (is_search() || is_archive()) { ?> <div class="excerpt-more"> <?php the_excerpt(__('Read More', 'island'));