0
votes
1answer
36 views

Hide H1 Title using the_title filter

I am trying to hide the pages H1 header IF a custom field specifies this. On a page back end I have added a custom field: Name = hide_title Value = true I then want to hide only the H1 using a ...
0
votes
2answers
52 views

Admin filter/error if post title is too long

Is there a filter that will throw an error if the posts creator enters a post title that is too long? I am looking to throw an error like: "The title you've entered is more than 30 characters. Please ...
0
votes
1answer
49 views

Strip $before & $after strings from a page title

So I have plugin that pulls remote data (real estate listings) into a wordpress site. I have been asked by a client to allow the page title for each listing to be set based upon that information and ...
0
votes
1answer
56 views

Why would apply_filters return a non-empty string, when the value returned is empty?

Been breaking my keyboard over this. Did a proper install, uploaded the database to a fresh MySQL and been working on using child themes properly. But there is something plaguing me I can not figure ...
0
votes
0answers
31 views

Custom field in title

I'm trying to change the posts with no titles to 'custom field' + 'mystring'. So far I got this code. add_filter( 'the_title', 'ta_modified_post_title'); function ...
0
votes
0answers
67 views

Set post title and slug from meta fields not working

I have a custom post type where I have the post title disabled. I want to set the post title and slug from some custom fields. I was using this and it worked great, but since I've upgraded by site to ...
0
votes
0answers
55 views

How to update permalink on the fly?

So, Wordpress automatically generates the slug/permalink on the fly based on the post title after you click away from editing the title. Is there an action/filter hook for me to change those on the ...
0
votes
1answer
121 views

Which filter affects the 'entry-title' post class

I created a plugin setting a $var to true if the post belongs to category 'a', and set the same $var to false if the post belongs to category 'b', it works and I can get the correct value depends on ...
2
votes
2answers
285 views

Filtering 'the_title' with option to return subhead?

Problem: The WordPress iPhone app (and other WordPress-related smartphone apps) do not allow for much other than the Title and Body fields (i.e. no access to custom fields). Goal: My current ...
0
votes
1answer
2k views

Add a Span Around a Product Title in WooCommerce

I'm customizing a custom theme to use WooCommerce. One of the issues I've run into is adding a span tag around a product title on the single product page. I've figured out how to add a filter to the ...
0
votes
2answers
38 views

How do i remove the title from a specific page

Hi need to remove the title of a specific page, this one. I could do add_filter( 'the_title', ai1ec_remove_title ); function ai1ec_remove_title( $title ) { if( 'Calendar' === $title ) { ...
2
votes
3answers
622 views

Filter to modify post_title after image upload?

When I upload images, Wordpress 3.4.2 sets the Title to the base of the filename, such as "DSCN1234" or "IMG_1234". I'd like the Title to be left blank. The code that sets the Title during the upload ...
-1
votes
1answer
289 views

Changing document title only on a custom page template

Hi can anyone help with the below, please? I want to be able to change the contents of my HTML <title> tag only, so need to write an if / else statement. I'm getting myself a bit muddled as my ...
1
vote
2answers
76 views

How can I run this code once so that my generated post title doesn't keep changing on publish/update?

I have a custom post type called transaction, and on the post type's edit/publish screen I have removed the post title field. The post title is now being generated by the function below, which labels ...
1
vote
2answers
2k views

wp_title() empty on a static front page

I'm trying to use wp_title() to create a heading for my pages, but I'm using a static front page and, while all of the other pages render the title properly, the front page won't. This is what I'm ...
0
votes
1answer
121 views

Change page title from page using php via php executed from page/post itself

I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the ...
1
vote
1answer
3k views

Setting title using wp_title filter

I want to do something very simple but I'm stuck finding where in WordPress I need to perform this. When someone on my WordPress site visits a blog post page I want the title in the blog post to ...
0
votes
1answer
231 views

Can I change the “Home” text in the menu?

I’m pretty sure this can be done with a filter or some kind of find and replace, but I’m not sure how. I have a page called “Home” like so: When the link is displayed in my template it says ...
0
votes
1answer
523 views

Filter media upload attachment meta

I'm trying to determine a way to access the meta data for an image when it is first uploaded with the media uploader. Looking at the media_handle_upload() function in /wp-admin/includes/media.php I ...
2
votes
4answers
2k views

How to change wordpress post title?

How to change just wordpress post title but not menu items. add_filter('the_title', 'wordpress_title'); function wordpress_title(){ return 'New title'; }
2
votes
2answers
1k views

How to remove “Taxonomy name:” from wp_title

The wp_title-generated <title> in my custom taxonomy archive pages contains the singular taxonomy name with a colon. I can't figure out where this is coming from (or if it's default Wordpress ...
3
votes
3answers
2k views

How to correctly get post type in a the_title filter

I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's ...
0
votes
1answer
401 views

Why doesn't my simple the_title filter get applied?

I have added the code below to an active plugin, but it's having no effect on my posts. add_filter( ‘the_title’, ‘myfunction’); function myfunction($title) { return "Why won't this work?" . ...
0
votes
3answers
1k views

What's the proper way to use the get_image_tag filter?

I'm attempting to remove the title attribute for post thumbnails (on certain posts), and I assume the get_image_tag filter is the way to do this. However, what I've got so far isn't working. What do I ...