The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
3answers
38 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 ...
0
votes
1answer
24 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
22 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
28 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
36 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
27 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
45 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
34 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
107 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
215 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
0answers
39 views

Trying to combine a variable together

So I am not 100% sure if the is feasible so hopefully some one can point me in the appropriate direction. I am using the Advanced Custom Fields plugin and on my custom page template I am using the ...
0
votes
1answer
264 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 ...
3
votes
4answers
4k 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: ...
0
votes
2answers
185 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
54 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
0answers
134 views

How to show woocommerce product images along with it's title and caption

Please any body can tell me that, how can I put title and caption with woocommerce product images in bottom, same as like this site (http://golflikes.com/).
0
votes
1answer
112 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
2answers
65 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
81 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
3answers
258 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
180 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
420 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
819 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
172 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
74 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
371 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
456 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
63 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? ...
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 ...
1
vote
2answers
561 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
76 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 ...
0
votes
2answers
781 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. ...
1
vote
1answer
164 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
954 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
181 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
182 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()); ?>"> ...
0
votes
1answer
718 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
850 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 ...