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: Flexslider plugin | |
Plugin URI: https://github.com/gydoar/flexslier-plugin | |
Description: Plugin creado con Flexslider para WordPress | |
Version: 1.0 | |
Author: ANDRES DEV | |
Author URI: https://andres-dev.com | |
License: GPL2 | |
*/ |
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 post_type_flexslider() { | |
register_post_type( 'flexslider', | |
array( 'labels' => array( | |
'name' => __( 'Flexslider', 'andres-dev' ), | |
'singular_name' => __( 'Flexslider', 'andres-dev' ), | |
'all_items' => __( 'Todos los sliders', 'andres-dev' ), | |
'add_new' => __( 'Agregar nuevo', 'andres-dev' ), |
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
<!-- Place somewhere in the <head> of your document --> | |
<link rel="stylesheet" href="flexslider.css" type="text/css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script src="jquery.flexslider.js"></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
// inicializamos con la función de flexslider() | |
jQuery(document).ready(function($) { | |
$('.flexslider').flexslider({ | |
animation: "slide" | |
}); | |
}); |
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 | |
// Registrando estilos | |
function flx_registrar_estilos() { | |
// registrar | |
wp_register_style('flx_styles', plugins_url('css/flexslider.css', __FILE__)); | |
// colocar | |
wp_enqueue_style('flx_styles'); | |
} |
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 | |
add_image_size('thum-flx', 600, 280, true); // declaramos el nombre del thumbnail 'thum-flx' y su tamaño | |
add_theme_support( 'post-thumbnails' ); // agregamos soporte para que pueda funcionar |
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 | |
<div class="flexslider"> | |
<ul class="slides"> | |
<li> | |
<img src="slide1.jpg" /> | |
</li> | |
<li> | |
<img src="slide2.jpg" /> | |
</li> | |
<li> |
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 | |
// Creamos la función para mostrarlo desde el frontend | |
function flx_funcion($type='thum-flx') { | |
$args = array( | |
'post_type' => 'flexslider', | |
'posts_per_page' => 5 | |
); | |
$result = '<div class="flexslider">'; | |
$result .= '<ul class="slides">'; | |
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 | |
// creamos un shortcode llamado [flx-shortcode] para llamarlo donde deseemos | |
add_shortcode('flx-shortcode', 'flx_funcion'); |
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 | |
/** | |
* Theme support Blocks | |
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/ | |
*/ | |
function andres_gutenberg_default_colors() | |
{ |
OlderNewer