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
| /** | |
| * Get ACF File | |
| * | |
| * @param string $key – the ACF field key | |
| * @param string $post_id – the ID of the post (if empty, will use $post->ID) | |
| * @return string The image URL | |
| **/ | |
| function get_acf_file( $key = 'file', $post_id = '' ) { | |
| if($post_id == ''): | |
| global $post; |
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 | |
| /** | |
| * Добавляем произвольный тип записи со всеми настройками | |
| * https://wp-kama.ru/function/register_post_type#hilsjs_extra_css | |
| * Генератор Post Type https://generatewp.com/post-type/ | |
| * Ютуб https://www.youtube.com/watch?v=iRLhKNXNIzI | |
| * Вывод https://wordpressrus.ru/wordpress/vyvod-proizvolnyh-tipov-zapisej-wordpress.html | |
| */ | |
| add_action('init', 'create_services_type'); |
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 add_email_to_sendpulse($contact_form) { | |
| $wpcf7 = WPCF7_ContactForm::get_current(); | |
| $submission = WPCF7_Submission::get_instance(); | |
| $data = $submission->get_posted_data(); | |
| $cur_email = $data['Email']; | |
| if ($cur_email != '') { | |
| define( 'API_USER_ID', '' ); |
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
| // Register Custom Taxonomy | |
| function ess_custom_taxonomy_Item() { | |
| $labels = array( | |
| 'name' => 'Brands', | |
| 'singular_name' => 'Brand', | |
| 'menu_name' => 'Brands', | |
| 'all_items' => 'All Brands', | |
| 'parent_item' => 'Parent Brand', | |
| 'parent_item_colon' => 'Parent Brand:', |
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
| https://truemisha.ru/blog/wordpress/ajax-pagination.html | |
| Навигация | |
| <?php if ( $wp_query->max_num_pages > 1 ) : ?> | |
| <script> | |
| var ajaxurl = '<?php echo site_url() ?>/wp-admin/admin-ajax.php'; | |
| var true_posts = '<?php echo serialize($wp_query->query_vars); ?>'; | |
| var current_page = <?php echo (get_query_var('paged')) ? get_query_var('paged') : 1; ?>; | |
| var max_pages = '<?php echo $wp_query->max_num_pages; ?>'; | |
| </script> |
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 | |
| /** | |
| * Plugin Name: Convert ACF PHP to JSON | |
| * Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
| */ | |
| namespace ConvertAcfPhpToJson; | |
| /** | |
| * Add submenu item under 'Custom Fields' |
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 | |
| // Get all the local field groups and loop through them for processing. | |
| $field_groups = acf_get_local_field_groups(); | |
| foreach ( $field_groups as $group ) { | |
| // If the field group has fields, load them into the 'fields' key. | |
| if ( acf_have_local_fields( $group['key'] ) ) { | |
| $group['fields'] = acf_get_local_fields( $group['key'] ); | |
| } |
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() { | |
| /* Define a variável que dá swipe no lightbox */ | |
| var magnificPopup = $.magnificPopup.instance; | |
| /* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
| $("a.image-lightbox").click(function(e) { | |
| /* Espera carregar o lightbox */ | |
| setTimeout(function() { | |
| /* Swipe para a esquerda - Próximo */ |
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() { | |
| /* Define a variável que dá swipe no lightbox */ | |
| var magnificPopup = $.magnificPopup.instance; | |
| /* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
| $(".open-popup-link").click(function(e) { | |
| /* Espera carregar o lightbox */ | |
| setTimeout(function() { | |
| /* Swipe para a esquerda - Próximo */ |
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 the_tags('<ul class="myteginfo"><li>','</li><li>','</li></ul>'); ?> | |
| //Автор | |
| <?php the_author(); ?> | |
| //дата | |
| <?php the_time('d.m.Y г. H:i') ?> // Год 22.12.2015 | |
| <?php the_time('d.m.Y г. H:i') ?> // Год и время |