This file contains 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_filter( 'the_content', 'my_the_content_filter', 20 ); | |
function my_the_content_filter( $content ) { | |
if ( is_single() ) | |
{ | |
global $post; | |
$field = get_fields($post_id); | |
$imgLnk=get_bloginfo( 'stylesheet_directory' ); | |
$pgLnk=get_post_meta($post->ID, 'Button', true); | |
$content .= '<div class="cf-wrap">CF go here<br> ' .$field. '</div>'; |
This file contains 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_filter('body_class','mrfx_add_category_to_single'); | |
function mrfx_add_category_to_single($classes, $class) { | |
if (is_single() ) { | |
global $post; | |
foreach((get_the_category($post->ID)) as $category) { | |
// add category slug to the $classes array | |
$classes[] = $category->category_nicename; | |
} | |
} | |
// return the $classes array |
This file contains 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
Try this. Add the code below to your functions.php file - | |
<? add_shortcode('cat_description', 'my_cat_description_shortcode'); | |
function my_cat_description_shortcode($atts){ | |
$a = shortcode_atts( array( | |
'id' => 0, | |
), $atts ); | |
return category_description($a['id']); |
This file contains 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
<script> | |
var element = document.querySelector("#docentes .fusion-column"); | |
element.onPress.className += " activo"; | |
</script> |
This file contains 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
jQuery( document ).ready(function($) { | |
$( "#someid p" ).click(function() { | |
$( this ).toggleClass( "activo" ); | |
}); | |
;}); |
This file contains 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_image_size( 'areas', 400, 300, true ); | |
add_shortcode( 'areas', 'custom_query_shortcode' ); | |
function custom_query_shortcode( $atts ) { | |
// EXAMPLE USAGE: | |
// [areas show_posts="100" post_type="page" post_parent="246"] | |
// Defaults | |
$defaults = array( |
This file contains 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
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} | |
/* As a mixin */ | |
@mixin centerer { | |
position: absolute; | |
top: 50%; |
This file contains 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://wordpress.org/plugins/custom-content-shortcode/ | |
<div class="section group wrap"> | |
[loop type=post category=my-category-slug count=10] | |
<div class="section group"> | |
<div class="col span_1_of_2"> | |
[field image size="image-size-name"] | |
</div> | |
<div class="col span_1_of_2"> | |
<div class="fecha">[field date]</div> |
This file contains 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
@mixin mixinName ($param: 10px) { | |
line-height: $param; | |
font-size: $param; | |
} | |
// https://css-tricks.com/the-extend-concept/ |