Ejemplo n.º 1
0
?>
">
	</div>

	<div class="form-group">
		<label for="snippet_desc">توضیحات تکه‌کد <small>مختصر و مفید</small></label>
		<?php 
wp_editor($snippet ? $snippet->post_content : '', 'snippet_desc', array('textarea_name' => 'submit_snippet[content]', 'editor_height' => '150px', 'media_buttons' => false, 'tinymce' => true, 'editor_class' => 'form-control'));
?>
	</div>

	<div class="form-group">
		<label for="snippet_lang">زبان تکه‌کد</label>
		<select class="form-control" name="submit_snippet[lang]" id="snippet_lang">
			<?php 
$current_lang = $edit ? snihub_snippet_language($edit) : false;
$terms = get_terms('language', array('hide_empty' => false));
foreach ($terms as $term) {
    $selected = $term->slug == $current_lang ? ' selected' : '';
    echo '<option value="' . $term->slug . '"' . $selected . '>' . $term->name . '</option>';
}
?>
		</select>
	</div>

	<div class="form-group">
		<label for="snippet_tags">برچسب&zwnj;ها (حداکثر 3تا. با کامای لاتین جدا کنید)</label>
		<input type="text" name="submit_snippet[tags]" class="form-control" value="<?php 
if ($edit != false) {
    echo snihub_tags_comma($edit);
}
Ejemplo n.º 2
0
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
								<p><?php 
        the_content();
        ?>
</p>
								<?php 
        $code = get_post_meta(get_the_ID(), 'code', true);
        if ($code) {
            ?>
								<pre class="line-numbers">
<code class="language-<?php 
            echo snihub_snippet_language(get_the_ID());
            ?>
"><?php 
            echo $code;
            ?>
</code>
								</pre>
								<?php 
        }
        ?>
								<div class="row">
									<div class="pull-left">
										<?php 
        $cat = snihub_cat_data(get_the_ID());
        $class = 'btn-warning';
        if (is_tax('language', $cat['title'])) {