How do I properly code my footer? See example

you can use this code in the footer … <div class=”your-class-name”> <?php _e(‘Copyright &copy ‘, ‘textdomain’); ?> <?php echo date(‘Y’); ?> | <?php _e(‘Made by Dev ‘, ‘textdomain’); ?>| <a href=”#”><?php _e(‘Privacy Policy Terms of Use’, ‘textdomain’); ?></a> </div>

Display an image based on field value

How about this? <?php $meta = get_post_meta( get_the_ID(), ‘region’, true ); if ($meta == ‘NA’) { ?> <img src=”https://www.esrnetwork.com/wp-content/uploads/2016/12/NA.png” width=”25″ height=”25″/> <?php } elseif ($meta == ‘EU’) { ?> <img src=”https://www.esrnetwork.com/wp-content/uploads/2016/12/EU.png” width=”25″ height=”25″/> <?php } else { } ?>

How can I split my query result in 2 arrays?

There’s no need to split the array, you can just close the first div once you’ve counted up to four elements of the array. $args = array( ‘post_type’ => ‘event’, ‘meta_key’ => ‘date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 8, ‘meta_query’ => array( ‘key’ => ‘date’, ‘value’ => date(‘Y-m-d’,strtotime(“today”)), ‘compare’ => ‘>=’, ‘type’ … Read more

Concatenate Custom Field Value & HTML Value

To display the_meta () after the ‘by author for’ text just needs a small change: <p style=”text-align:left;font-size:18px;margin-bottom:5px;”><span style=”color: #000000;”>By AUTHOR FOR</span> <?php the_meta (); ?></p> However I’m not sure you want to use the_meta (), because all values get displayed, and in an unordered list. (Reference: the_meta.) Instead you probably want get_post_meta, so: <p style=”text-align:left;font-size:18px;margin-bottom:5px;”><span … Read more

PHP Redirect condition

If you want it to run as early as possible, which makes sense if you want to avoid loading unnecessary assets, put the code in a function in a Must Use Plugin, and hook that function to the muplugins_loaded action. <?php add_action( ‘muplugins_loaded’, ‘wpd_my_redirector’ ); function wpd_my_redirector() { // your code here // wp_redirect is … Read more

Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile

I can’t give more than a partial answer here, since the details might depend on the peculiarities of your theme and installation, including UM and how you’re using it. Without installing and cracking open UM, too, I’m not sure I could figure out why you’re getting the unexpected results you’re getting. However, if you want … Read more

Posts are not looping through correctly

I just tested the following example code: <?php $the_query = new WP_Query( array( ‘posts_per_page’ => 12, ‘paged’ => get_query_var(‘paged’, 1) )); if ( $the_query->have_posts() ) { // display #ajax wrapper only if we have posts echo ‘<div id=”ajax”>’; while($the_query->have_posts()) { $the_query->the_post(); ?> <article <?php post_class(); ?>> <div class=”row”> <div class=”col-md-4″><?php the_post_thumbnail(‘medium-thumbnail’); ?> <h2><a class=”post-title” href=”https://wordpress.stackexchange.com/questions/252035/<?php … Read more

call_user_func_array() expects parameter 1 to be a valid callback, function ‘———-‘ not found or invalid function name

Like your previous questions answer if you have called any class method you need to reference the class. So you need to replace this line $theme_options = $mafongroup_menu_page_creation_method( $page_title, $menu_title, $capability, $menu_slug, $function,’dashicons-image-filter’, ‘2.111111’); With this one- $theme_options = $mafongroup_menu_page_creation_method( $page_title, $menu_title, $capability, $menu_slug, array( $this, $function ),’dashicons-image-filter’, ‘2.111111’); So your above code will be … Read more

dynamically create callback functions inside a for loop

Probably you can do it with args: ‘callback’ => benz_new_product_tab_content, ‘args’ => ‘_tabs_content_’ . $y And your function: function benz_new_product_tab_content($param, $args) { global $post; $table = end($args); $benz_tab_content = get_post_meta( $post->ID, $table, true ); if (strlen($benz_tab_content) > 0) { echo $benz_tab_content; } } One alternative is to create anonymous function like this: ‘callback’ => function() … Read more