This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function update_post_title_from_customfield( $post_id ) { | |
| $saved_post = array(); | |
| $saved_post['ID'] = $post_id; | |
| $field = get_field('date_date_day'); | |
| if (get_post_type() == 'date' && $field) { | |
| $saved_post['post_title'] = $field; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends 'parent.twig' %} | |
| {# remove meta from its default location #} | |
| {% block aside_meta '' %} | |
| {% block article %} | |
| {{ block('meta') }} | |
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $font-sizes: ( | |
| xxxs: (fs:12px, lh:1.167), | |
| xxs: (fs:14px, lh:1.21), | |
| xs: (fs:17px, lh:1.235), | |
| s: (fs:19px, lh:1.21), | |
| m: (fs:21px, lh:1.19), | |
| l: (fs:35px, lh:1.14), | |
| xl: (fs:48px, lh:1.167), | |
| xxl: (fs:100px, lh:1.18), | |
| xxxl: (fs:110px, lh:0.735) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function mytheme_loadmore_posts_ajax_callback() { | |
| $args = array( 'post_type' => 'post', 'offset' => $_POST['offset'] ); | |
| $loop = new WP_Query( $args ); | |
| while ( $loop->have_posts() ) : $loop->the_post(); | |
| the_title(); | |
| echo '<div class="entry-content">'; | |
| the_content(); | |
| echo '</div>'; | |
| endwhile; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Remove all classes in a Wordpress-based menus, except those given | |
| function css_attributes_filter($var) { | |
| return is_array($var) ? array_intersect($var, array('current-menu-item','current_page_item','current-page-ancestor','current-menu-ancestor','current-menu-parent')) : ''; | |
| } | |
| add_filter('nav_menu_css_class', 'css_attributes_filter', 100, 1); | |
| add_filter('nav_menu_item_id', 'css_attributes_filter', 100, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('a.header').mouseup(function() { | |
| this.blur(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Remove categories and tags | |
| function unregister_categories() { | |
| register_taxonomy( 'category', array(), array('show_in_nav_menus' => false) ); | |
| } | |
| add_action( 'init', 'unregister_categories' ); | |
| unregister_widget( 'WP_Widget_Categories' ); | |
| function unregister_tags(){ | |
| register_taxonomy('post_tag', array(), array('show_in_nav_menus' => false)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add metabox to attachment edit page that will allow users to choose if to show this image in logo gallery | |
| function add_our_attachment_meta(){ | |
| add_meta_box( 'custom-attachment-meta-box', | |
| 'Дополнительные настройки медиафайла', | |
| 'attachment_metabox_callback', | |
| 'attachment', | |
| 'normal', | |
| 'low' | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $nid = $variables['view']->result[$id]->nid; | |
| $array = array($nid); | |
| $view = views_get_view('travel_destination_header'); | |
| $view->set_display("block"); | |
| $view->set_arguments($array); | |
| $view->pre_execute(); | |
| $view->execute(); | |
| $content = $view->render(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print render(field_view_field('node', $node, 'field_my_textfield', array( | |
| 'label'=>'hidden', | |
| 'type' => 'text_summary_or_trimmed', | |
| 'settings'=>array('trim_length' => 10), | |
| ))); |