Add static image block to lastest list item
Add static image block to lastest list item
Add static image block to lastest list item
Here’s what I ended up with: Everything within my child-theme file example-single.php for displaying individual posts within a template file example.php a new template as a destination for new routes. new routes and a filter on ‘pre_get_posts’ All of the following can simply go in functions.php in the child theme: function example_routes() { // add … Read more
I make sticky post for my archive page for custom post type with ACF field and loop is not working
It’s possible that there’s an issue with your SMTP configuration or with the mailing queue. You can try using a debugging plugin, such as WP Mail Logging, to help diagnose the issue. This plugin logs all emails sent through WordPress and displays them in the admin dashboard, allowing you to see if the emails are … Read more
You need to add an if statement current loop to print out a year container around your articles. <?php if( have_posts() ) : ?> <?php $current_year = date(‘Y’); // Get the current year and set it $first = true; // Set a $first variable; while ( have_posts() ) : the_post(); if ( $first || get_the_date(‘Y’) … Read more
Use something like this for each column. <!– custom field = ‘normal’ –> <div class=”span2 normal”> <?php // The Query $the_query = new WP_Query( array( ‘meta_key’ => ‘your_custom_field_name’, ‘meta_value’ => ‘normal’ ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo ‘<div class=”post”> <h1>’ . get_the_title() . ‘</h1> </div>’; endwhile; // Reset Post Data … Read more
Try this: Paste it on functions.php (not tested) add_action(‘template_redirect’, ‘my_user_redirect’); function my_user_redirect(){ if(!is_user_logged_in()){ // only redirect use not logged in wp_redirect( home_url( ‘welcome’ ), 301 ); exit; } } Let me know if it worked.
As with any custom tables in your database, you can override the SQL that WP_Query ends up using. For this use case, I’d suggest not using WP_Query’s arguments and building your own function to do this instead as it could simplify the logic and complexity. <?php add_filter( ‘posts_clauses’, ‘my_custom_wp_query_posts_clauses’, 10, 2 ); /** * Custom … Read more
Sometimes the mail port can get clogged up, so I usually add a brief sleep(10) in the for-loop. The 10 seconds is arbitrary, but it works for my purposes. foreach($entries as $key=>$entry){ $email = array( ‘[email protected]’ ); $subject = “Documents Requested”; $headers = array(‘Content-Type: text/html; charset=UTF-8’); $message = getDMVemailMessage($entries[$key][‘id’]); $sent = sendDMVNotifyEmail($email, $subject, $message, $headers); … Read more
Hook in the loop after the first post