/** add_action( 'generate_after_entry_header', 'cs_add_featured_image' ); function cs_add_featured_image() { if ( is_single() && has_post_thumbnail() ) { the_post_thumbnail(); } } /** /** add_action( 'generate_before_footer','cs_add_related_posts' ); function cs_add_related_posts() { $relatedPosts = get_field( 'posts_relacionados' ); if( $relatedPosts ): echo ''; endif; } **/ /**add_action( 'generate_after_entry_content','cs_add_inline_related_posts' ); **/ function cs_add_inline_related_posts() { if ( is_singular() ) { $inlinerelatedPosts = get_field( 'inline_post_relacionado' ); if( $inlinerelatedPosts ): ob_start(); echo '
'; echo '
' . get_field( "titulo_post_relacionado_inline" ) . '
'; foreach( $inlinerelatedPosts as $inlinerelatedPost ): // variable must NOT be called $post (IMPORTANT) echo ''; endforeach; echo '
'; $ReturnString = ob_get_contents(); ob_end_clean(); return $ReturnString; endif; } } add_shortcode( 'inlinerelatedpost', 'cs_add_inline_related_posts' ); add_filter( 'generate_sidebar_layout', 'cs_custom_post_sidebar_layout' ); function cs_custom_post_sidebar_layout( $layout ) { $post_types = array( 'recetas', 'nombre' ); if ( in_array( get_post_type(), $post_types ) ) { return 'no-sidebar'; } return $layout; } /** * Filter the upload size limit for non-administrators. * * @param string $size Upload size limit (in bytes). * @return int (maybe) Filtered size limit. */ function filter_site_upload_size_limit( $size ) { // Set the upload size limit to 60 MB for users lacking the 'manage_options' capability. if ( ! current_user_can( 'manage_options' ) ) { // 60 MB. $size = 6024 * 10000; } return $size; } add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 ); /** * Añade opciones de formato a TinyMceEditor. * */ function add_style_select_buttons( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } // Register our callback to the appropriate filter add_filter( 'mce_buttons_2', 'add_style_select_buttons' ); //add custom styles to the WordPress editor function my_custom_styles( $init_array ) { $style_formats = array( // These are the custom styles array( 'title' => 'Green Button', 'block' => 'span', 'classes' => 'green-button', 'wrapper' => true, ), array( 'title' => 'Content Block', 'block' => 'span', 'classes' => 'content-block', 'wrapper' => true, ), array( 'title' => 'Highlighter', 'block' => 'span', 'classes' => 'highlighter', 'wrapper' => true, ), ); // Insert the array, JSON ENCODED, into 'style_formats' $init_array['style_formats'] = json_encode( $style_formats ); return $init_array; } // Attach callback to 'tiny_mce_before_init' add_filter( 'tiny_mce_before_init', 'my_custom_styles' ); function custom_editor_styles() { add_editor_style('editor-styles.css'); } add_action('init', 'custom_editor_styles'); add_action( 'after_setup_theme', 'cs_theme_setup' ); function cs_theme_setup() { add_image_size( 'homepage-thumb', 270, 293, true ); add_image_size( 'homepage-thumb-2', 270, 324, true ); add_image_size( 'destacados', 265, 198, true); add_image_size( 'destacados-2', 420, 300, true); } add_action( 'template_redirect','tu_add_elementor_filter', 999 ); function tu_add_elementor_filter() { if ( in_array( 'elementor-page elementor-page-' . get_the_ID(), get_body_class() ) ) { add_filter( 'body_class', 'tu_add_elementor_classes' ); add_filter( 'generate_show_title','__return_false' ); } } function tu_add_elementor_classes( $classes ) { $classes[] = 'full-width-content'; return $classes; } // Filter Functions with Hooks function custom_mce_button() { // Check if user have permission if ( !current_user_can( 'edit_posts' ) & !current_user_can( 'edit_pages' ) ) { return; } // Check if WYSIWYG is enabled if ( 'true' == get_user_option( 'rich_editing' ) ) { add_filter( 'mce_external_plugins', 'custom_tinymce_plugin' ); add_filter( 'mce_buttons', 'register_mce_button' ); } } add_action('admin_head', 'custom_mce_button'); // Function for new button function custom_tinymce_plugin( $plugin_array ) { $plugin_array['custom_mce_button'] = get_stylesheet_directory_uri().'/js/editor_plugin.js'; return $plugin_array; } // Register new button in the editor function register_mce_button( $buttons ) { array_push( $buttons, 'custom_mce_button' ); return $buttons; } Página de mantenimiento | Pequeocio.com

Estamos haciendo mejoras en nuestra web

¡Volvemos muy pronto!