Confusing problem with displaying message recipient metadata

As I see it, you could replace some things in the switch. You need to open and close , tag in the same case rule, do this avoid a lot error. Like this switch( $column ) { case ‘recipientname’ : <div class=”recipentusername”><a href=”https://wordpress.stackexchange.com/questions/243290/<?php echo um_user_profile_url(); ?>” target=”_blank”><?php _e(“”, ‘front-end-pm’); ?> <?php echo implode( $name );?> … Read more

Custom query using WP_Query is not working

Its not clear what the goal is here, but here are some suggestions: In general, the pre_get_posts hook is not a good place to instantiate a secondary query to display HTML. Your current setup will result in an infinite-loop, because when you instantiate WP_Query within the pre_get_posts callback, you will instantiate it recursively, until you … Read more

Is there a way to have chunks of a page’s content expire?

If you don’t mind wrapping your content in Shortcode then you can easily have them hidden after a specific time. Granted you don’t cache the page for longer than needed. Wrap your content in [content_expires] shortcodes. Time should be based on your server’s timezone. [content_expires]NEVER Expires[/content_expires] [content_expires date=”2016-10-25 00:00:00″]PAST[/content_expires] [content_expires date=”2116-10-26 04:20:00″]FUTURE[/content_expires] Then add the … Read more

Displaying dynamic content (blog posts/portfolio) on a static homepage and keep the blog post styles

I don’t if this is what exactly you need! I am assuming you have created portfolio page and just wanted to show it on front page with other content of front page. You can call any page to your front page with following code $include = get_pages(‘include=10’); //Assigning ID of page $content = apply_filters(‘the_content’,$include[0]->post_content); echo … Read more

How to make an If Else on Excerpt Filter

Here is the solution that seemed to work. Thanks Tom function new_excerpt_more($more) { global $post; $thePostID = $post->ID; if($thePostID == 1128) { return ‘…<a class=”readmore” href=”‘. get_permalink($post->ID) . ‘”>Watch Video &raquo;</a>’; } else { return ‘…<a class=”readmore” href=”‘. get_permalink($post->ID) . ‘”>Read more &raquo;</a>’; } } add_filter(‘excerpt_more’, ‘new_excerpt_more’);

Add a data attribute to list item element in menu

try this code in your functions file. function add_class_to_nav_items($nav_items, $args) { if ( $args[‘theme_location’] == ‘MY_NAV_THEME_LOCATION’ ) { // IMPORTANT: replace MY_NAV_THEME_LOCATION with the location of your menu foreach ($nav_items as &$nav_item) { $nav_item->classes[] = ‘custon-class-name’; } } return $nav_items; } add_filter( ‘wp_nav_menu_objects’, ‘add_class_to_nav_items’, 11 );

Difference between modified post and new post

Add a post class when the post modified time doesn’t match publish time. Then style it with that class. add_filter( ‘post_class’, ‘wpse244651_add_modified_class’ ); function wpse244651_add_modified_class( $classes ) { global $post; if( get_the_modified_time( $post->ID ) != get_the_time( $post->ID ) ) { $classes[] = ‘modified-post’; } return $classes; }