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){ $user_id = $usermeta[‘user_id’]; $userdata = get_userdata($user_id); $email = $userdata->data->user_email; //echo $email; $links=””; foreach($ids as $id){ $link = get_permalink($id); $links .= … Read more

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’ => ‘drinks’, ‘numberposts’ => -1 )); ?> <?php foreach ($rows as $post) : setup_postdata($post) ?> <?php the_post_thumbnail() ?> <h3><?php the_title() ?></h3> <?php the_content() ?> <?php the_permalink() ?> <?php … Read more

Changing title of a page dynamically from within a plugin

Every WordPress page can be described as having two titles: The page/post title, which is displayed within the page/post via the the_title() function call The html <title></title> tag that displays the title on top of the browser I am writing a plugin which at one point should change the title of a page dynamically (well, … Read more

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: add_filter(‘manage_edit-mycpt_columns’, ‘replace_title_products’); function replace_title_products() { $oldtitle = get_the_title(); $newtitle = str_replace(array(“<span class=”sub-title”>”, “</span>”), array(“”, “”),$oldtitle); $title = esc_attr($newtitle); return $title; } … Read more