How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and … Read more

Run a function on all posts

Rather than hooking into init or wp_load, here is a snippet you can drop into functions.php or on a theme file. I put it behind a $_GET so that you can only hit it once and when you are ready. Something like https://domain.com/page/?update_post_meta // Hide it from the public if(isset($_GET[‘update_post_meta’])){ // Let’s query all of … Read more

Yoast taking over my WordPress title tag [closed]

That’s not what the SEO title does/is for. It appears that you’ve used the wp_title() function in your template by mistake. wp_title() is intended for use in the <title> tag in the <head> for setting the browser tab/document title. However, since WordPress 4.1 this has been superseded (but not officially deprecated, yet) by add_theme_support( ‘title-tag’ … Read more

Change/Set Page Title and Meta Tags from Page Called within a Plugin

Attach to wp_head action hoook function that will display meta tag. Inside that function you can: add your own filter that will allow you to change the value, or change tag value depending of your query vars (sign1, sign2, …) or conditional tags. add_action( ‘wp_head’, ‘se344297_description_metatag_display’, 0 ); function se344297_description_metatag_display() { $site_descr = apply_filters( ‘description_tag_filter’, … Read more

About title on a page

The best way to modify how a theme presents an archive is to create a child theme and then create a specific altered version of the page you want “fixed”. Template files follow a hierarchy with the most specific file available used. In your case, you could create a file called something like category-finanzasya.php (depending … Read more

Page titles for internal classification of landing pages

The easiest way to do this without editing the page.php template in your theme is to add it as a custom field, then use a plugin (or code) to display that custom field in the control panel on your Pages list. The plugin I’d recommend is Admin Columns. It’s free and highly-rated. Once that’s installed, … Read more

Edit the post title from the frontend

Yes, you can change post title and slug from frontend. by using wp_update_post you can change title and slug of post. in below code, it will update post title and slug of post_id. Replace your-post-title-field with your title field in form. slug will generated using that post title. if ( isset( $_POST[‘my_image_upload_nonce’], $_POST[‘post_id’] ) && … Read more

Replace image name on upload to the new post name on front-end form

You can use sanitize_file_name filter to rename file. put this code in active theme’s functions.php, this will rename image filename as postname if only get title request. I have tested this code and it is working fine. Post name : https://prnt.sc/q3thzw Uploaded renamed image : https://prnt.sc/q3tib7 function make_filename_as_post_name($filename) { $info = pathinfo($filename); $ext = empty($info[‘extension’]) … Read more

How to display featured image description and title?

this might work: $post_thumbnail_id = get_post_thumbnail_id($post->ID); $thumbnail_image = get_posts(array(‘p’ => $post_thumbnail_id, ‘post_type’ => ‘attachment’)); if ($thumbnail_image && isset($thumbnail_image[0])) { $img_description = $thumbnail_image[0]->post_content; $img_caption = $thumbnail_image[0]->post_excerpt; $img_alt = get_post_meta($post_thumbnail_id , ‘_wp_attachment_image_alt’, true); $img_title = $thumbnail_image[0]->post_title; }

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