ACF: Hide a div or template section when a custom field (in a field group) is empty

Hope this help how to figure out your request <?php $werdegang = ‘werdegang’; // werdegang parent group $station1 = ‘jahr_station_1’; // ‘ child group 1 $station2 = ‘jahr_station_2’; // ‘child group 2 $station3 = ‘jahr_station_3’; // ‘child group 3 $station1Jahr=”jahr1″; $station2Jahr=”jahr2″; $station3Jahr=”jahr3″; $station1Title=”jahr1_Title”; $station1Text=”jahr1_Text”; $station2Title=”jahr2_Title”; $station2Text=”jahr2_Text”; $station3Title=”jahr3_Title”; $station3Text=”jahr3_Text”; ?> <?php if( (!empty($station1Title) && !empty($station1Text)) && … Read more

Get custom taxonomy value of post and output posts in same taxonomy

try with this function function get_posts_in_taxonomy($post_type, $taxonomy, $term_id, $include_children=false, $limit) { $args = [ ‘post_type’ => $post_type, ‘posts_per_page’ => $limit, ‘tax_query’ => [ [ ‘taxonomy’ => $taxonomy, ‘terms’ => $term_id, ‘include_children’ => $include_children ], ], // Rest of your arguments ]; $posts = new WP_Query( $args ); if($posts->have_posts()) { while($posts->have_posts()) { $posts->the_post(); //code todo here … Read more

How to change wordpress registration form submit button value?

you would have many options to change button text like jquery and if you know about that registration form from where it is coming from. By using jquery you would have to add below code at the end of the footer.php file like as below: <script> $(document).ready(function(){ // Change text of input button $(“.ur-submit-button”).prop(“value”, “Input … Read more

How to display a list of authors in bootstrap grid?

Not many ways to style the wp_list_author but you can use the style => ‘list’ argument to display authors in <li> and then style your <ul>as wanted. https://developer.wordpress.org/reference/functions/wp_list_authors/ <div class=”container”> <div class=”row”> <div class=”col-lg-4″> <ul class=”d-flex”> <?php wp_list_authors( array( ‘exclude’ => 4, ‘show_fullname’ => 1, ‘optioncount’ => 1, ‘orderby’ => ‘post_count’, ‘order’ => ‘DESC’, ‘number’ … Read more

How to implement template file and the loop

I have seen that there is extra (); so maybe this syntax error prevent display in front-end please try below code – <?php /** * Template Name: Basic Test */ get_header(); if ( have_posts() ) : while ( have_posts() ) : the_post(); the_title(); endwhile; else : _e( ‘Sorry, no posts matched your criteria.’, ‘textdomain’ ); … Read more

Loop inside page template not working

From https://wordpress.org/support/article/creating-a-static-front-page/, Posts Page: (if not already created) create an empty page. Give it a Title that will be used on top of your posts list. This step is mandatory as you are modifying the WordPress default setting. Any other content other than Title will no be displayed at all on this specific page. So, … Read more

Rewrite Rule working different than expected

I’ll add another answer because the rule is only a part of the problem. Here is what I have tested and is working : <?php class BadRewritesRules { public function __construct() { add_action(‘init’, [$this, ‘custom_post_types_rewrite_rules’]); remove_filter(‘template_redirect’, ‘redirect_canonical’); } public function custom_post_types_rewrite_rules() { add_rewrite_rule(‘(blog)/([0-9-]+)[/]?$’, ‘index.php?pagename=$matches[1]&paged=$matches[2]’, ‘top’); } } new BadRewritesRules(); In reality, I used another URL … Read more