The tag has no wiki summary.

learn more… | top users | synonyms

8
votes
3answers
1k views

How to change the case of all post titles to “Title Case”

I am helping my father with his WordPress website. It has over 1,700 posts with TITLES IN UPPERCASE. We'd like to change these to "Title Case" in the database (possibly using this PHP script). The ...
6
votes
1answer
4k views

Change page title in admin area

Is there someway to change the title in wp-admin? Been looking all over google but no one seem to mention it. I simply want to get rid of "— WordPress" and possibly change the "‹" into ...
6
votes
2answers
2k views

How to prevent apostrophes and quotes from appearing in permalinks?

I'm using custom permalinks "/%category%/%postname%/". Whenever a post title contains quotes or apostrophes they appear in the URL. Can someone tell me how prevent them from appearing in the slug? ...
5
votes
4answers
16k views

query_post by title?

is it possible to create a loop of posts using WP_Query or query_posts using the title? ie $args = array('post_title'='LIKE '.$str.'% '); $res = WP_Query($arg); // the loop... // trying this ...
5
votes
4answers
11k views

How to get current-menu-item title as variable?

Is possible to get current-menu-item as a php variable? I'm listing the category museums via the menu item 'museums we support' so i'd like the get 'museums we support' bit and display it somewhere? ...
5
votes
5answers
4k views

How can I add title attributes to next and previous post link functions?

For some reason a title attribute is not appended to next_post_link and prev_post_link calls in WordPress. How can I add one?
5
votes
1answer
9k views

Translate widget titles using qTranslate plugin

I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to ...
4
votes
2answers
1k views

Is there any way to dynamically alter widget titles?

I have a case where that are a lot of widgets in several custom sidebars. I am wondering if there is a simple way to alter the titles of each widget dynamically. Typically a widget has a title field ...
4
votes
2answers
5k views

How to get permalink and title from post ID?

I have stored an array of post IDs and I would like to list the posts as links, meaning I need to get the title and permalink for the post ID - $id. The list should be echoed out by the following if ...
3
votes
4answers
3k views

Force post slug to be auto generated from title on save

I'm running a property site where many properties are sold in apartment blocks. Because of this what the content editors do is create a post/property with all the details and then use a duplicate ...
3
votes
3answers
4k views

How do I get a post (page or CPT) ID from a title or slug?

I've scoured the Codex, failed to get get_page_by_title() to work and am quite surprised that there doesn't seem to be a standard WP function for this task. I need to get the ID of any given post/ ...
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 ...
3
votes
1answer
4k views

get attachment title based on attachment id

I'm getting an image through getMeta. It returns me the id of the attachment. Now I want to get the titel, alternative text, description and so on. For the alternative text this works very well: ...
3
votes
2answers
193 views

Changing title to lowercase [closed]

Lets say i have 100 posts. And i would like to lowercase the title. but only 70 of it. I cant use text-transform or mb_strtolower. Is there anyway to download posts and lowercase the title with ...
3
votes
1answer
145 views

Fill post titles from post content?

I imported over 1000 posts from a Tumblr gallery. All the posts are untitled, but each has a photo and name inside of the post. How do I make take the content of each post and make it the post name?
3
votes
4answers
5k views

How to get page's ID if I know the title only?

Is there an exact opposite funciton to this one: get_the_title(ID) I know there's: get_the_id() But it doesn't seem to accept any arguments. So, basically, I'm looking for something like: ...
3
votes
3answers
953 views

Set Custom Post Type title to the Post's Date

I have a custom post type, called 'status' and I have disabled 'title' in the post type. Right now it's setting all posts to have the title "Auto Draft". I want to set up a way to set the title to be ...
3
votes
1answer
134 views

Remove post title input from edit page

I'd like to remove the post title input on a (cpt) post edit page (backend) based on user's capabilities. I have already found Stack Overflow question dealing the problem. However, the solution in ...
3
votes
4answers
674 views

What is the proper filter to add html to a post / page title?

I want to use Myanmar Unicode text on my blog. Unfortunatly, pseudo-Unicode Myanmar fonts are common. So, I am writing a plugin that will suround all Myanmar phrases with HTML span tags, and use css ...
3
votes
4answers
796 views

How I check if the same post slug has not been used before publishing?

For an indie rock agenda I created event posts. With the help of javascript, the custom fields values (bands, places and date info picked in select boxes) are copied as the post title when publishing ...
3
votes
2answers
75 views

What hook is executed just after wp_query has been executed?

What hook is executed just after wp_query has been executed? before template is rendered? I want to change the page title but it depends on what has been queried. I have put it in template_redirect ...
3
votes
3answers
2k views

Change the_title() of a page dynamically

I'm developing a plugin that doesn't use a custom post type, but separate database tables. It's a plugin that displays a list of courses with links that lead to the different course detail pages, ...
3
votes
2answers
495 views

Copy a Taxonomy Term into the Post Title for a certain Custom Post Type

I am using Gravity Forms to allow users to create posts from the front end. However, the way this site I am building is going to work, one specific Post_Type is essentially just a "Data" post. There ...
3
votes
1answer
948 views

Bulk edit wordpress images alt and title attributes

I uploaded around 600 pictures in different galleries in wordpress without setting the titles and alt attributes. I need to edit them, I was wondering a way to edit them by album, let's say the title ...
2
votes
3answers
7k views

How Do I Set the Page Title Dynamically?

Is it possible to change the page title with code? For example, let's say the page's name is "Book your Order", but I want to change it to "Book Order #123". I Google'd a bit and looked here and ...
2
votes
2answers
143 views

How to count the length of a post title?

Let's say that I have an entry titled Crime & Punishment I tried to count the number of characters of my entry titles using the following line: echo strlen( get_the_title() ); I expected the ...
2
votes
2answers
1k views

order by second word in title?

I have full names as title posts and want to order it by the surname. How could i do this with wordpress? in PHP it would be along the lines of - SELECT * from posts ORDER BY ...
2
votes
2answers
286 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 ...
2
votes
2answers
779 views

Disallow Same Post Title

I am looking for some code where member can't use the same title as another post already having or used. e.g if there is a post with title "Amazing Australia Tour" than it should not allow to use the ...
2
votes
1answer
2k views

Get title of post without using the_title();

Noob question. Is there another way of getting a posts title without using the_title(); I'm asking because I am using a function the take a string parameter, then after some code, returns this ...
2
votes
2answers
971 views

page title, parent tilte and grand parent title

I am using a page hierarchy and I want to show the title of the parents and grand parents page (if there is any). The structure is something like Startpage Startpage > Second page Startpage > ...
2
votes
3answers
624 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 ...
2
votes
2answers
409 views

Changing “Enter title here” based on post format

I'm wondering if is possible to change the text "Enter title here" based on the post format that you selected? For example: If you select the post format Quote than your text will be "Enter author's ...
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 ...
2
votes
2answers
406 views

What code do you use to generate the text to go into the HTML title tag?

The question title says it all. Myself I just stick with the default code from one of the packaged templates that comes with WordPress out of the box: <title><?php /* * Print the ...
2
votes
2answers
104 views

How to make a H1 different then the Title?

What I want to do is... on a per page/post basis I want to be able to have the H1 say something different then the Title... This should be such a simple thing, but I've been looking around for an ...
2
votes
1answer
77 views

How come my first blog post and my home page have the same title?

I am putting together a new blog and for some reason the home page took the title and description of the initial post. Is there a way to just set the home page title/description separately? I am ...
2
votes
1answer
191 views

How to intercept Post Title on Post-Save

I am new to WP and I couldn't find this solution by myself. this is my function, function explodetitletotags() { global $post; $title = $post->post_title; $tags = explode(' ', ...
2
votes
1answer
539 views

title_save_pre on post publish

I'm trying to build the title of a custom post using the values within post custom fields. The problem is that using title_save_pre only executes when I update the post, not when I create it. When I ...
2
votes
1answer
222 views

How to add terms to a post depending on its title?

I want to add all posts with keyword "Dog Training" in the post title to a specific category. Reason: If you enter something into WordPress search it's not an exact match. Previous WordPress search ...
2
votes
2answers
3k views

When calling wp_title(), do you have to create some kind of “title.php” file?

... or does wp_title() already handle the various contexts in your blog? This could clarify for me how I can achieve a reusable index.php file without having all the conditional statements inside it ...
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
1answer
633 views

Posts created in a Custom Post Type are lost if published without a title

I searched around and the URL below is all I could find on this problem. If I publish a custom post type's post without entering in a post title, it wipes the whole post's info and says "published". ...
2
votes
1answer
96 views

Why doesn't YoastSEO allow me to set the title/description for the home page?

For some reason, YoastSEO set my home page to the first blog post. So the home page canonical, title, and description are set to the values of the first blog post. And when I tried to set the home ...
2
votes
1answer
639 views

How to add a CSS class to the tooltip on a navigation menu?

I'm looking for a way to add a CSS class to the anchor tag of the tooltip on a menu item. Currently, I see that you can easily add a CSS class to the menu's li but I'm trying to style the tooltip ...
2
votes
1answer
1k views

How To Set Custom Post Type Title Without Supports

So, I asked this question differently in another thread but it was more of an advice type question so it really didn't render any useful responses. I believe I can word it better and should help some ...
2
votes
1answer
281 views

Display post title on individual image attachment page

How to display parent post title on individual image attachment page heading of the post gallery? Currently, it shows image name as page heading on image attachment page. Any help appreciated. Thanks ...
2
votes
2answers
285 views

Testing for post title in 'if/else' statement returns no content

I'm testing for a certain fixed post on an about page, I guessed that the best way is to test for post title (?). Here's my code, what's going wrong? <?php if (is_page()) { ...
2
votes
1answer
198 views

Browser title script ignoring is_page /else conditional [closed]

I've used this code to stipulate different separators for different pages in my clients site: <title> <?php if(is_page('Portfolio')){ wp_title( 'of', true, 'right' ); echo ...
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 ...