Adding a prefix to a post title

There are probably a few ways to handle this. Here’s one way using a checkbox to enable the prefix for individual posts, and a filter on the_title to add the prefix whenever the_title() is called for those posts. 1. Add a meta box for an on/off checkbox a. Add the meta box to the post … Read more

use get_posts to get custom field data, but in one array

You can alter your foreach loop as following to get concert date and city pair in single multidimentional array as following. $concert_query = array(); $i = 0; foreach($c_query as $post) : setup_postdata($post); $concert_query[$i][‘concert_date’] = get_post_meta(get_the_ID(), ‘concert_date’, true); $concert_query[$i][‘concert_city’] = get_post_meta(get_the_ID(), ‘concert_city’, true); $i ++; endforeach; print_r($concert_query);

Custom contact form 7 select with custom values [closed]

You can set the values with the filter wpcf7_form_tag and add the shortcode attributes with the filter shortcode_atts_wpcf7 add_filter(“wpcf7_form_tag”, function($scanned_tag, $replace){ if (“press_post” === $scanned_tag[“name”]) { $contact_form = WPCF7_ContactForm::get_current(); $number_of_posts = $contact_form->shortcode_attr(“number_of_posts”); $post_type = $contact_form->shortcode_attr(“post_type”); // using $number_of_posts and $post_type here $scanned_tag[‘raw_values’] = [ “number_of_posts \”$number_of_posts\” – post_type \”$post_type\” | val 1″, “Test 2|val 2”, … Read more

Geocoding an Exploded Custom Field Array

This isn’t a complete answer, but a couple of bits of advice – Don’t geocode the addresses on front-end requests, it’s a waste of cycles. An address only needs to be geocoded once, then you can store the lat/lon data with your post meta. Use a save_post hook to do the geocoding when the post … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)