The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
6 views

get document title meta using javascript [migrated]

i'm trying to implementing this simple script below, which would display the document title as assigned by wordpress (or an seo plugin) when the browser tab is in focus, and display an altrenate doc ...
0
votes
1answer
19 views

Wrong post title displayed from loop

I'm building my own theme. I have a page set for my blog (with a template that I made) which I'd like to just display a few of my posts. It uses the following loop: <?php ...
-1
votes
3answers
23 views

Show page name in browser

I am developing my first WP theme and would like to know how to display page name for every page/post instead of just "mysiteaddress.com" How can I set that all my posts and pages show the tittle by ...
0
votes
1answer
31 views

the_title not working

I'm using the_title() to show the title of a custom post type, but it's not working; the title does not show. get_header(); $wp_query = new WP_Query(); $wp_query -> ...
-1
votes
1answer
49 views

Enter a variable in the 'category_name' parameter

Is it possible to use a variable for the 'category_name' parameter? I have three pages: red, yellow, and blue. I have multiple posts that are categorized in three categories: red, yellow, and blue. ...
0
votes
1answer
43 views

Show post title words one by one [closed]

How to show post title words one by one, but to exclude words with 3 or less characters. Also it would be nice to be able to exclude some words, for example to make some list of words to exclude from ...
-1
votes
2answers
57 views

Title displaying multiple times

I'm facing a problem where my title is being displayed multiple times. Using the following code the page title 'News' is displayed 10 times, the same number as the number of posts I've elected to ...
1
vote
1answer
43 views

Get post/page title from ID

I'm trying to get the post title of a post_type (post/page/portfolio) in the admin panel outside of the loop. I nearly tried all possible solutions, but without success: //method 1 $content_post = ...
0
votes
1answer
25 views

Include category name in page template

The theme I am using inserts and styles the page title using this code. I would like to display the category name depending on whatever it is for that category. I have tried a number of methods but ...
2
votes
2answers
267 views

Replacing the title in admin list table

Here is my situation: I am trying to filter the content of the title column in my custom post type edit table but I can't get it working. Here is what I have tried: ...
1
vote
1answer
192 views

posts order by title second word

This is a common question, i haven't been able to find a straightforward answer to. I want to generate a list of a custom post type titles. im using 'orderby' => 'title' to have them display ...
0
votes
1answer
70 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
66 views

Custom Post Type title not populating

I am attempting to get the title displayed for a function. I am sending myself an email to see if I can get this to work for different titles. Currently the only way I can get it to work is via hard ...
1
vote
3answers
132 views

Multiple Conditions for Child Page Title

I've been trying to work with Conditional Tags and cannot wrap my head around this problem. PHP novice here. On sub-pages I need to display the parent page title as well as the page title. I have it ...
1
vote
1answer
75 views

Get post title with link

I am using this code to send an email from my wordpress site. It send permalinks of the posts. How can i edit this to have linked titles instead of just permalinks; if(count($ids) > 0){ ...
0
votes
1answer
59 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 ...
-1
votes
1answer
115 views

single_term_title() running before get_the_title() [closed]

This is a strange "problem" but I've had this happen on a few installs and I was wondering if anybody could give an explanation on why / how this happens. On a blog category if I code: <?php ...
-1
votes
2answers
400 views

Problem with get_the_title in <a href“”> not rendering the way I want

It's quite hard to put a title on this question. So the problem is if my page title is "BLA BLA" my href link will not work. <a href="#<?php echo get_the_title();?"> <?php echo ...
0
votes
0answers
40 views

get_permalink() echoing about us page link only. how to solve this.?

I am trying to build an own theme for my wordpress site. I am using the following code to get a 3 posts on my home page. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = ...
0
votes
1answer
65 views

how do I get the title in the post [closed]

I have a custom grid loop to show a specific post type on a page. This shows the excertp for each post but it does not link include the post title, and I would like each post to have a title that ...
0
votes
1answer
51 views

Remove space when post title is blank

I want my custom post type title leave no spaces when there is no title in the post. I tried to use following code but is removed h1 and other tag. Please help. <?php if (the_title() != '') { ...
-1
votes
1answer
193 views

Replace get_the_title and the_exerpt with custom arrays

Here is the code in home.php: <?php get_header(); ?> <div class="pikachoose"> <ul id="pikame" > <?php $cat1 = stripslashes(get_option('lx_feat_cat')); //The Query ...
2
votes
1answer
638 views

the_title(); works in a page template, outside the loop. Why?

Trying to wrap my head around the loop concept... Given a template page (page-work.php) with just this code: <?php the_title(); ?> WP correctly shows the title of that page. As I understand ...
0
votes
1answer
509 views

Get title of post image is attached to

So I found this post: Find the post an attachment is attached to and implemented Chip's suggestion but having a weird outcome. I am trying to pull the title of the post that the specific image is ...
0
votes
2answers
646 views

get the_title_attribute by id

I'm creating a list with a few permalinks which I call to with <a href="<?php echo get_permalink($id); ?>" title=".... And for the title I want to call the_title_attribute(). But it seems it ...
0
votes
1answer
68 views

Can't get full post title if there a spaces in title

I want to make a custom query that checks the post title and puts in a different URL like this: <a href=bing.com/search?q=<?php echo single_post_title(); ?>>Blablabla</a> But it ...
0
votes
2answers
135 views

Get post title of faulty link on 404 error page

My users can link to things that don't exist on the page. That's something I chose because it is the best option for my concept. Anyway, what I want to do is this... Let's say I clicked on a link that ...
0
votes
1answer
104 views

get_the_title outputs title until spacing; it does not get full length of title

If I have a post with a spacing in it (like: Hello World), than get_the_title shows me only "Hello" as a link and not the whole permalink. I already tried using a substring to get it done, but it did ...
0
votes
1answer
158 views

How to get all post titles starting with numbers and symbols?

I want to get all posts which are starting with a number (0-9) or symbols, in a list. I managed to get it work for letters, but this one is harder for me. Can someone help me out please? I tried ...
0
votes
3answers
398 views

Add title to image post

I can't add the title on a featured image in the recent posts. try this but only get the alt <?php $default_attr = array( 'src' => $src, 'class' => "attachment-$size", ...
0
votes
1answer
245 views

Blog Title not showing up on main Blog page

I cannot get the main blog page with the current blog to show the current blog title. It shows on all other pages, just not the current/most recent blog. Any help will be greatly appreciated. Thank ...
0
votes
1answer
664 views

Title on hovering on the featured image

I have used the following code to make a slideshow of the featured image of a category.I want to show the title of the post when hovering on the image. But I don't know how to do it. Anyone please ...
0
votes
1answer
1k views

How to add hook to the_title() and get_the_title()

I've having trouble with accented characters now if i do utf8_decode() before echoing the title the problem is solved but instead of changing this all over my theme, can't I do this in one place that ...
2
votes
1answer
204 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(' ', ...
0
votes
1answer
95 views

How to get changed post title in my custom plug-in which fires when 'save_post' is called?

I created a custom WordPress plug-in that hooks onto 'save_post" using add_filter(). I need to do something with the post titles and whenever a user changes the title, my plug-in cannot get the new ...
1
vote
1answer
549 views

wordpress get gallery images title

I am retrieving some images post with: $img = wp_get_attachment_image_src( $attachment_id, 'full' ); How can I retrieve the image title? Thanks.
4
votes
2answers
651 views

the_title() and the_permalink() won't work on AJAX calls

I've run into a strange problem. I have a custom loop built with get_posts that works fine when loading the page normally: <?php $rows = get_posts(array( 'post_type' => ...
1
vote
1answer
68 views

Can't get title of latest post

I've just started learning PHP/Wordpress yesterday - here is one of my first plugins. Unfortunately, it's not working like it's supposed to - the title doesn't display. What's wrong with my code? ...
1
vote
2answers
628 views

custom field to always to .get_the_title()?

Is there a way to have always the the_title(); tag also includes a custom field called subtitle? I want to have a title like this: "subtitle-custom-fild: Posttitle" Like "Cool: The new TV show from ...
0
votes
1answer
87 views

Generate page title tag from the content of H1

Is there any way of generating the title tag of a page from the content of an H1 tag on my wordpress page? I've got some dynamically generated content pulled in via an external XML feed and and at the ...
1
vote
1answer
213 views

Get url-friendly version of the_title?

How can I get an url-friendly version of the post_title? I´m using anchor links for my posts on an archive page, and for the moment the posts get the post_ID as a hash tag but I would like to get the ...
0
votes
1answer
1k views

How to display thumbnail + tags + title of a child page?

What do I need to do to display thumbnail + tags + title of a child page? [ Thumbnail ] [ Title ] [ Tags ] Thanks! EDIT: Well this work, but only showing thumbs+title... it shouldnt be too ...
0
votes
2answers
246 views

How can I remove the first two words and shorten get_the_title()

Some of my posts' titles have leading words, followed by a colon. I am removing the leading words and the column of every post title in the loop with the following: <?php $title = ...
0
votes
1answer
231 views

Including a post title in a twitter link

Im trying to make a Twitter button on each article of my blog. This is the code I use on single.php <a href="http://twitter.com/home?status=<?php echo urlencode(get_the_title()); ?>"> ...
2
votes
3answers
2k views

How to split up the_title and insert a span tag

My titles, site wide, will follow this theme all within a h1 tag: Main title heading / Sub-title text I'm trying to wrap a span tag around all text after and including the '/' so my markup will look ...
0
votes
1answer
975 views

Random Custom Post Type Titles

So i found the code below from another question on here, it displays a list of titles from a custom post type, my question is, How do i get the list to randomize? <?php $queryObject = new ...
0
votes
1answer
1k views

get_the_title and get_permalink outside of the Loop

I'm trying to list the parent to a page in the sidebar. I can get the parent-page ID. I can get it to print with a print_r function, but no matter what I try I can't get get_permalink and ...
0
votes
2answers
905 views

Can't Get Parent and Child Categories of Custom Taxonomy to Display

I have a Custom Post Type set up with a Custom Taxonomy. For this Custom Taxonomy, I'm trying to figure out how to echo out the titles of the parent category and current child category within it. ...
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: ...