Set post title from two meta fields

You are using wrong variable on the following line: $data[‘post_title’] = $post_title; you should use $event_title in $post_title as following: $data[‘post_title’] = $event_title; Also Get Post ID from $postarr parameter. Updated Code : function set_event_title( $data , $postarr ) { if($data[‘post_type’] == ‘events’) { $event_date = get_post_meta($postarr[‘ID’],’event_datetime’,true); $event_venue = get_post_meta($postarr[‘ID’], ‘venue_name’ , true); $event_title = … Read more

Anyway to edit the titlebar of WordPress Widgets in the Admin area?

I believe you are looking for $params = apply_filters( ‘dynamic_sidebar_params’, $params ); (look here: https://github.com/WordPress/WordPress/blob/master/wp-includes/widgets.php#L706). Now this filter will evaluate both in front end and back end. so to answer your question, you could wrap your filter in a if( is_admin() ){ // Do icons } check. Better yet, you could define this at registration … Read more

REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()

WordPress added support for the title-tag feature in version 4.1 and it’s now a required feature for themes uploaded to the repo. To implement this feature, make sure your theme does not have the title tag hard coded within header.php, e.g.: <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title> Configure your theme with title-tag support like … Read more

Empty title on front page/Home

The title is empty at the front page in WordPress. Yes, that sucks. Just put the separator into wp_title(): <title><?php // separator, print immediately, separator position wp_title( ‘·’, TRUE, ‘right’ ); bloginfo( ‘name’ ); ?></title> This prints out just the blog name on the front page and PAGE NAME · BLOG NAME on other pages.

Fill post titles from post content?

Hook into the_post – called when the post is actually used – and fill the title. Be aware the slug has to be changed too. If you are used not to enter a title, hook into save_post too, and let the same code do this for you. The code Download on GitHub <?php /** * … Read more

Dynamically update post title in admin page

The block editor is restoring back the title that was last saved (or typed manually into the textarea), so with the block editor, you can change the title dynamically using this code: wp.data.dispatch( ‘core/editor’ ).editPost( { title: ‘Title here’ } ) PS: You should make sure your JS file has the wp-editor, wp-edit-post or wp-data … Read more

Changing title to lowercase [closed]

Assuming this question is related to WordPress, here is answer :- You can update the titles directly into your mySQL database using simple update function. one of my user publishs all his posts uppercase (title) i want to edit them and make it normal. – Using some conditional statements as I mentioned in this code, … Read more

How to count the length of a post title?

There are actually two problems: The & is encoded as &amp;, so you have to use html_entity_decode() first. Multi-byte characters need more than one byte, and strlen() will fail with them. Don’t use strlen(). So use something like this: $title = html_entity_decode( get_the_title(), ENT_XML1, ‘UTF-8’ ); $length = mb_strlen( $title, ‘utf-8’ );

Modify page title format (when using title-tag)

If you’re using the Yoast SEO plugin (which it looks like you are) then this answer might help you If you are using yoast SEO plugin then the easiest method is to remove the archive word from “titles & metas-> Taxonomies->category” find: %%term_title%% Archives %%page%% %%sep%% %%sitename%% replace it with: %%term_title%% %%page%% %%sep%% %%sitename%% Alternatively … Read more

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