Calling Yoast SEO title in widget not work

0 votes

I install Wordpress SEO plugin by Yoast, test the title re-write function and it works in my title bar (single post). However when I try to call the title in widget, I just get error message

Warning: Missing argument 1 for kpndg()...

I insert this code in theme functions.php

add_filter( 'wpseo_title', 'kpndg' );
function kpndg( $title )  {
    return $title;
} 

Then call it in my widget:

$out.='<div class="trending-bar add-active bar-' . $i . '">';

    $out.='<a class="trending-link" href="'.get_permalink().'">&nbsp;</a>'; 

    $out.='<div class="title">'.kpndg().'</div>';

    $out.='<div class="trending-color-wrapper">';
        $out.='<div class="trending-color-layer"></div>';
        $out.='<div class="trending-color"></div>';
        $out.='<div class="trending-meta">' . $meta . '</div>';
    $out.='</div>';

$out.='</div>';

I can't figure out what is the problem in that code.

Mar 6 in Digital Marketing by Kichu
• 16,250 points
30 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Digital Marketing

0 votes
0 answers

Calling Yoast SEO title in widget not work

I just install Wordpress SEO plugin by ...READ MORE

Mar 4 in Digital Marketing by Kichu
• 16,250 points
15 views
0 votes
1 answer

How to remove home page title in Yoast SEO?

Here, you have two possibilities. You can ...READ MORE

answered Mar 4 in Digital Marketing by narikkadan
• 7,860 points
83 views
0 votes
0 answers

.htaccess give 404 Not Found when url in SEO-friendly URL

Im using opencart fresh install and using ...READ MORE

Mar 4 in Digital Marketing by Kichu
• 16,250 points
26 views
0 votes
0 answers

SEO URL for information pages in opencart not working

I'm trying to create custom SEO URL's ...READ MORE

Mar 8 in Digital Marketing by Kichu
• 16,250 points
22 views
0 votes
0 answers

SEO in WebSphere Portal (Page Title)

I know that you can change the ...READ MORE

Mar 8 in Digital Marketing by Kichu
• 16,250 points
18 views
0 votes
0 answers

Setting a Custom SEO Title Using Yoast Wordpress SEO API

I've just installed this plugin on my ...READ MORE

Mar 10 in Digital Marketing by Kichu
• 16,250 points
50 views
0 votes
1 answer

How to Access Yoast SEO tags in Wordpress API Callback

use rest api to request for the ...READ MORE

answered Feb 12 in Others by narikkadan
• 7,860 points
53 views
0 votes
1 answer

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

get_post_meta(), use this to get the meta ...READ MORE

answered Feb 11 in Others by narikkadan
• 7,860 points
28 views
0 votes
1 answer

Simple question regarding PHP, Wordpress & Yoast SEO

the way the search engine displays your ...READ MORE

answered Feb 14 in Others by narikkadan
• 7,860 points
26 views
0 votes
1 answer

how can I change yoast seo generated sitemap file URL?

plugins/wordpress-seo/inc/sitemaps/class-sitemaps-router.php go to this directory and change the ...READ MORE

answered Feb 22 in Others by narikkadan
• 7,860 points
172 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP