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 | |
$post_idx = 0; | |
if ( have_posts()) { | |
while ( have_posts()) { | |
the_post(); | |
// $post_idx is available in content-page.php | |
include( locate_template( 'content-page.php' ) ) | |
$post_idx += 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
<?php | |
add_action( 'rest_api_init', 'slug_register_siglings' ); | |
function slug_register_siglings() { | |
register_api_field( 'post', | |
'siblings', | |
array( | |
'get_callback' => 'slug_get_siglings', | |
'update_callback' => null, | |
'schema' => null, |
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_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); | |
function my_theme_enqueue_styles() { | |
wp_localize_script( | |
'script', | |
'i18n', | |
array( | |
'download' => __( 'Download file', 'mytheme' ), | |
) | |
); |
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 Counter () { | |
var count = 0; | |
function logNewValue() { | |
console.log("Count is " + count); | |
} | |
return { | |
add: function () { | |
count += 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
<?php | |
$field_config = wpcf_admin_fields_get_field( 'field-id' ); | |
$field_options = array(); | |
if ( isset( $field_config['data']['options'] ) ) { | |
foreach ( $field_config['data']['options'] as $option ) { | |
if ( isset( $option['value'] ) ) { | |
$field_options[ $option['title'] ] = $option['value']; | |
} | |
} |
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_query = new WP_Query( array( | |
'orderby' => array( 'menu_order' => 'ASC', 'title' => 'DESC' ), | |
) ); |
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 $object_id = apply_filters( 'wpml_object_id', YOUR-PAGE-ID-HERE, 'page' ); ?> | |
<a href="<?php echo get_permalink( $object_id ); ?>"> | |
<?php _e( 'Link text', 'text-domain' ); | |
</a> |
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 echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<modification> | |
<id>ExampleId</id> | |
<version>0.1</version> | |
<vqmver>2.5.1</vqmver> | |
<author>Ville6000</author> | |
<file name="catalog/view/theme/journal/template/product/product.tpl"> | |
<operation> | |
<search position="replace"><![CDATA[<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />]]></search> |
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_filter( 'wpseo_breadcrumb_links', 'override_yoast_breadcrumb_trail' ); | |
function override_yoast_breadcrumb_trail( $links ) { | |
if ( get_post_type() === 'employee' ) { | |
$breadcrumb[] = array( | |
'url' => get_permalink( get_page_by_title( 'contact' )->ID ), | |
'text' => __( 'Contact', 'your-text-domain' ), | |
); |