By default WordPress post listing will embed with #more tag. If you do not like the #more tag like me, you can remove the #more tag using wordpress filter. In case you do not know what is #more tag, here’s the explanation. Whenever user click on the “read more” link at the post listing, it will redirect user to the single post page and auto focus on the anchor tag. I dun find this very useful but caused of confusion to my readers.
To remove the #more in WordPress listing, follow the steps below:-
Advertisements
- Login to your wordpress
- Go to Appearance -> Editor
- Click on functions.php at the right sidebar
- Copy and paste the code below, and click “Update File”
function remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'remove_more_jump_link');
- Now the #more jump at the post listing should have removed
Credit: Codex
Related posts:
WordPress: add javascript event after widget save
How to register a free @microsoft.com email account?
Prestashop 1.5 - How to enable add to cart button at Home Featured Product?
Limit certain ip to access website with .htaccess
How to configure Thunderbird for IMAP email?
Redirect to maintenance page during upgrade using .htaccess
Virtue Theme: How to disable broken image if featured image is set
WordPress Custom Taxonomy Pagination show 404 page not found error
Share this with your friends:-
Thanks from Turkey π
this is very useful. it worked for me. God bless all
Exactly what I needed. Simple and effective. Thanks for sharing!
Useful!
tnks
merry christmas
hi Inxxu, if you didnt see any functions.php file, you may create one and insert the code and it should work.
sometimes some template do not have this functions.php file, you can just create yours.
hope this helps
hello there π
Well, I have tried all sort of things and mostly because no one says “where” in the function.php file I can put this code exactly ..I have tried to put it every possible place, but nothing… Can anyone of you tell me that specific place… ???
I use Filezilla to view and edit my WP blog.. there I can find that function.php file, but when I go WP administration–>appearance–> editor, then there are no such file as function.php
As I am new to programming language, I hope that you all donΓΒ΄t mind me asking such question.. :$.. I really do hope that someone of you can help me, because I have wasted 3 days to solve this problem… huh π
Regards,
Inxxu
and don’t forget to place that’s all
It’s Work Great Thanks .
you forgot opening and closing. Dave, this will fix the problem, as I had same problem as you.
hi Dave, in your function file, it should be start with <?php in line 1
else it will show your error
My site just screwed up after updating the functions file with the above code. It’s giving the following error Warning: Cannot modify header information – headers already sent by (output started at (url)
Thanks! Thanks! Thanks!
thanks, I was looking for this for a minute
Nope, doesn’t work for me neither.
Great solution! It works perfect! I think sometimes people forget to make correct file permisions before edit files.
it doesnt work for me >_<
I love you dude, that was perfect π