<?php if( have_rows('call_to_actions') ): ?>
<?php while( have_rows('call_to_actions') ): the_row();
?>
<?php
$link = get_sub_field('button');
if( $link ):
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
?>
<div class="btn-wrap">
<a class="btn btn-primary scoli-primary-btn" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?> <i class="material-icons">arrow_forward</i></a>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
/**
* Removes buttons from the second row (kitchen sink) of the tiny mce editor
*
* @link http://thestizmedia.com/remove-buttons-items-wordpress-tinymce-editor/
*
* @param array $buttons The default array of buttons in the kitchen sink
* @return array The updated array of buttons that exludes some items
*/
add_filter('mce_buttons_2', 'jivedig_remove_tiny_mce_buttons_from_kitchen_sink');
function jivedig_remove_tiny_mce_buttons_from_kitchen_sink($buttons)
{
$remove_buttons = array(
// 'formatselect',
// 'underline',
// 'alignjustify',
'forecolor',
// 'pastetext',
// 'removeformat',
// 'charmap',
// 'outdent',
// 'indent',
// 'undo',
// 'redo',
// 'wp_help',
);
foreach ($buttons as $button_key => $button_value) {
if (in_array($button_value, $remove_buttons)) {
unset($buttons[$button_key]);
}
}
return $buttons;
}
Here is an example where I have created a custom post type called faq_categories.
in the settings for the custom post type, ensure the following is set to true:
<?php
$args = array(
'post_type'=>array('faq', 'faqs'),
'taxonomy' => 'faq_categories',
'faq_categories' => 'patient'
);
query_posts($args);
if ( have_posts() ) : ?>
<!-- do something -->
<?php endif;
wp_reset_query()
?>
I had an issue with the LinkedIn post inspector displaying the words footer-text within the snippet. It turns out that the og:title was not respected at LinkedIn. The problem was WordPress itself - not LinkedIn.
Disable the WP Rest API, and you are good to go. The contents of the oembed+json link that is embedded in the wp_head() creates the issue with the "title" being set to "id".
I achieved this by installing the Disable WP Rest API plugin for WordPress. This solved the problem and Linkedin displayed the posts as expected.
<?php
wp_nav_menu( array(
'menu_class' => 'kt-nav main-menu clone-main-menu',
'container' => '',
'items_wrap' => '<ul class="%2$s">%3$s</ul>'
) );
?>
<?php
// Define custom query parameters
$custom_query_args = array(
/* Parameters go here */
'posts_per_page' => 12,
'post_type' => 'video_production',
);
// Get current page and append to custom query parameters array
$custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
// Instantiate custom query
$custom_query = new WP_Query( $custom_query_args );
// Pagination fix
$temp_query = $wp_query;
$wp_query = NULL;
$wp_query = $custom_query;
// Output custom query loop
if ( $custom_query->have_posts() ) :
while ( $custom_query->have_posts() ) :
$custom_query->the_post(); ?>
Do stuff here
<?php
endwhile;
endif;
// Reset postdata
wp_reset_postdata();
// Custom query loop pagination
previous_posts_link( 'Older Posts' );
next_posts_link( 'Newer Posts', $custom_query->max_num_pages );
// Reset main query object
$wp_query = NULL;
$wp_query = $temp_query;
?>
Place this in your theme’s functions.php file.
/*-------------------------------------
Move Yoast to the Bottom
---------------------------------------*/
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
<?php
$terms = get_the_terms( get_the_ID(), 'bake-lovers-categories' );
if ($terms) {
foreach($terms as $term) {
echo '<span class="tag">'.$term->name . ' '.'</span>';
}
}
?>
<?php
$aust1 = types_render_field("available-in-australia", array("option"=>0));
if ($aust1) {
echo 'woolies';
}
$aust2 = types_render_field("available-in-australia", array("option"=>1));
if ($aust2) {
echo 'coles';
}
$aust3 = types_render_field("available-in-australia", array("option"=>2));
if ($aust3) {
echo 'other';
}
?>