Formatting with

The pages you are linking use two different characters, one is the &mdash and the other I don’t know the name, it does not translates into an Html entity… Original: 2——-2——-7——-7——-| <– Mixed characters Using the character that works: 2—2—7—7—| <– This one is not &mdash. You may consider using a shortcode to encapsulate the … Read more

Inconsistent behavior from number_format

Seems like the function you using is the the_field function from of ACF which is a function that outputs a string so the formatting number_formatt dosent effect the output. This code: <?php echo number_format(the_field(‘price’)); ?> The echo does not really print anything, the function the_fields prints the output, that’s the reason the number_format function doesn’t … Read more

What are the “U” and “G” time formats?

The U and G are not WordPress specific. get_post_time() is using the same datetime formats as the default PHP date method. Here is the documentation for all of the formats: https://www.php.net/manual/en/function.date.php Specific to the question: U is Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) G is 24-hour format of an hour without … Read more

How to center oEmbedded content

After some Googling, I found a solution that was originally done for a Twitter embed, but I modified it to work with all oEmbed contents. Keep in mind that for this to work on existing posts, you’ll need to do an “update” for the oEmbed content to refresh from the cache. add_filter(‘oembed_result’,’center_oembed’,10,3); function center_oembed($html, $url, … Read more

How to Include HTML in Excerpts?

The excerpt is created in -> wp-includes/formatting.php with this code: function wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( ” == $text ) { $text = get_the_content(”); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘\]\]\>’, ‘]]&gt;’, $text); $text = strip_tags($text); $excerpt_length = 55; $words = explode(‘ ‘, $text, $excerpt_length + 1); if … Read more

Filter string like a slug

You can use sanitize_title() function: $string = “This is title string”; // return “this-is-title-string” $slug = sanitize_title( $string ); You can also filter the result of sanitize_title() function using sanitize_title filter: add_filter( ‘sanitize_title’ , ‘sanitize_filter_callback’, 10, 3 ); function sanitize_filter_callback( $title, $raw_title, $context ) { // do something }

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