Calling Yoast SEO title in widget not work

0 votes

I just 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.

FYI: I use Engine theme by Industrial Themes

Mar 4, 2022 in Digital Marketing by Kichu
• 19,050 points
420 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 install Wordpress SEO plugin by Yoast, ...READ MORE

Mar 6, 2022 in Digital Marketing by Kichu
• 19,050 points
483 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, 2022 in Digital Marketing by narikkadan
• 63,720 points
2,974 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, 2022 in Digital Marketing by Kichu
• 19,050 points
1,100 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, 2022 in Digital Marketing by Kichu
• 19,050 points
831 views
0 votes
0 answers

SEO in WebSphere Portal (Page Title)

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

Mar 8, 2022 in Digital Marketing by Kichu
• 19,050 points
541 views
0 votes
1 answer

Setting a Custom SEO Title Using Yoast Wordpress SEO API

Firstly disable WordPress SEO by Yoast, then ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,720 points
1,163 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, 2022 in Others by narikkadan
• 63,720 points
1,785 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, 2022 in Others by narikkadan
• 63,720 points
1,452 views
0 votes
1 answer

Simple question regarding PHP, Wordpress & Yoast SEO

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

answered Feb 14, 2022 in Others by narikkadan
• 63,720 points
464 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, 2022 in Others by narikkadan
• 63,720 points
3,493 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP