How to Replace Words from Title
-
Hello,
How can i modify the code to replace the words in my title with something or nothing.
This code could achieve it:
$postTitle = str_replace( 'Blalbhalb', 'nothing', $postTitle );But i can’t figure out in which part and line should i place it that it does the job and not break the site too.
Regards.
-
and is tracking enabled by default ??
Hello @omusman ,
Thanks for choosing IntellyWP products.Please edit the following file intelly-related-posts/includes/core.php at line 154
and replace
$options[‘postTitle’]=$v->post_title;
with
$options[‘postTitle’]=str_replace( ‘Blalbhalb’, ‘nothing’, $v->post_title );
Could you please send us more details about tracking feature?
What do you mean?
Thank you
IntellyWP
Code does the job thank you.
$options[‘postTitle’]=str_replace( ‘Blalbhalb’, ‘nothing’, $v->post_title );While exploring the plugin to figure out how to replace the words. I saw tracking.php under utils and i saw this comment:
//We send once a week (while tracking is allowed) to check in which can be used
//to determine active sitesSo is the tracking features enabled by default or there will be a prompt asking the permission either agree or refuse to it ??
and i am using two [irp] shortcodes on all of posts so will there any heavy loads on server or heavy resource consumption and will it cause any duplicates query or showing same posts title on both [irp].
Hello @omusman ,
To disable this option please open the following link after the login on your website
yourwebsite.com/wp-admin/options-general.php?page=intelly-related-posts&tab=settings&track=0
Our plugin uses a WordPress native function to get the content of each post from the ID anyway you can remove the shortcode and configure the plugin from the option panel
Cheers
IntellyWP
and what about the duplicate posts or same posts on both the shortcode on same page, will it happen or not ??
Thank you for the support.
Cheers.
Hello @omusman ,
with a number of shortcodes higher than the available related posts, you will see one or more duplicates anyway i tested our plugin with two shortcode and five available post without any duplicate on the same page
Cheers
IntellyWP
Hello:
i am having a space after everypost title such as
PostTitle .
It shoud be:
PostTitle.
Code i used:
$options['postTitle']=str_replace( "Place", "", $v->post_title );When i revert the code to the default code:
$options['postTitle']=$v->post_title;The space is no more, the space is added after adding above str_replace code.
Hello @omusman ,
Could you please restore this customitation and replace it with
$options[‘postTitle’]=str_replace(‘Place’,”,$v->post_title);Thank you
IntellyWP
I applied the code, still the space is there.
Is this code working on your end ??
$options['postTitle']=str_replace('Place','',$v->post_title);Hello @omusman ,
yes, i tested successfully this code.Could you please send me the URL of your website?
Thank you
IntellyWP
I looked around and realized that its not a space by content or the code, its a whitespace by the str_replace.
This might be useful: Link
I guess there no way to replace a whitespace, i use str_replace to replace all the spaces then the spaces in title will also be replaced.
How its working on your end ??
Hey @omusman ,
Please see these screenshot, there are not empty space generated by str_replace PHP function
https://ibb.co/qRN3P1n
https://ibb.co/Zx5HfSYIntellyWP
I have a different case over here:
Will try with fresh installation of the plugin and perform the changes again.
will update you. 🙂
The topic ‘How to Replace Words from Title’ is closed to new replies.