delete an array element when its date expires
delete an array element when its date expires
delete an array element when its date expires
Separate out your logic from the string you want to return: <?php // Adding a shortcode to return each author’s social media links function funcauthor_social( $atts ){ $meta_socialgr = esc_url(get_post_meta( $post->ID, ‘author_goodreads’, true )); $output=”<div class=”authorsocial”><h5>Connect, Share & Follow</h5><ul>”; if (!empty($meta_socialgr)) { $output .= ‘<li><a href=”‘.$meta_socialgr.'”><img src=”http://fiddlehead.milkbossindustries.com/files/goodreads.jpg”></a></li>’; } $output .= ‘</ul></div>’; return $output; } add_shortcode( … Read more
There is no clean way to do this (that I notice from quick look at rather messy code of it), but $n_display is passed though formatting number_format_i18n() function which does have a filter. So you could try something like: function make_number_into_dot( $number ) { return ‘o’; } add_filter( ‘number_format_i18n’, ‘make_number_into_dot’ ); // your pagination handling … Read more
Okey i think i understand what you want to do. Here is a function that changes the html-output of the feature image in admin. It will look for the attached feature image ID and output it by using wp_get_attachemt_link() so you can change the size by the parameter $size. Here is a function that should … Read more
Store each custom field as a comma separated pair. Like this: option_name, option_image_URL Then we do this (within the loop)… $options = array(); foreach( get_post_custom_keys( $post->ID ) as $key ) { $a = get_post_meta( $post->ID, $key, true ) $a_array = explode( ‘,’, $a ); $options[] = $a_array[0] // first value of each array is the … Read more
You can generate a custom comment reply element like so: This will replace the **** HERE <SPAN> ELEMENT FOR REPLY-BUTTON WILL BE PLACED ****. <?php if ( get_option( ‘comment_registration’ ) && ! is_user_logged_in() ) : ?> <a rel=”nofollow” class=”comment-reply-login” href=”https://wordpress.stackexchange.com/questions/321913/<?php // wrapped echo esc_url( wp_login_url( get_permalink() ) ); ?>”>Log in to Reply</a> <?php else : … Read more
Dynamically loaded Theme components based on Customizer Settings values : changes not appearing in Customizer preview – (Workaround found)
Aftere long hours of research through the WordPress Codex and a variety of Forum Posts and tutorials. Here is the solution for my current issue. First I began by calling the current logged in user. <?php global $current_user; wp_get_current_user(); ?> From there I connected to the database. Seeing as I added the table within the … Read more
Authenticating to WordPress, using my own authentication two-factor system
The root of your problem is not object oriented programming, but a fundamental misunderstanding about how PHP handles requests. If this were a Java or a Node application for example, you would start the application on the server, and it would recieve requests, and respond. It’s a continuous active program. As a result, you can … Read more