Auto-Generate Longtail-SEO Pages/URLs

Hm, likely if there are complete lists of options for “mood” and “location” than there could just be a script that generates all combination of them and – while generating – double check if there is actually enough content for them. And then put them in the sitemap that google uses for getting to know … Read more

Display HTML only if Custom Field has a Value

You can use the “get_sub_field” to test for the subfields. If nothing is returned and they are empty, it won’t show the content associated with the if statement. <?php if ( get_field(‘ingredients-list’) ) { echo ‘<ul class=”ingredientsList”>’; while ( has_sub_field(‘ingredients-list’) ) { echo ‘<li class=”ingredient” itemprop=”ingredients”>’; echo ‘<label for=””>’ . get_sub_field(‘quantity’) . ‘&nbsp; ‘; if … Read more

What is content.php file that is needed for Jetpack infinite scroll plugin?

There is no standard for a content.php in WordPress, that’s why you cannot find in the Codex. Some themes use it to render the post content. So instead of … while ( have_posts() ) { the_post(); ?><li <?php post_class(); ?>> <?php the_title( ‘<h2><a href=”‘ . get_permalink() . ‘”>’, ‘</a></h2>’ ); the_excerpt(); wp_link_pages(); ?></li> <?php } … Read more

How to format shortcode’s HTML in external file

function wpse450_show_video( $atts ) { extract(shortcode_atts(array( ‘id’ => 0 ), $atts )); if( is_numeric($id) ) { $ngvideo_title = get_the_title($id); } ob_start(); include ‘path/to/file/video.php’; return ob_get_clean(); } add_shortcode( ‘ngvideo’, ‘wpse450_show_video’ ); You can use $id, $atts in our file as you would in your function. The code in your file will behave just like it would … Read more