signale
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Content Shortcode] Looping through posts and pages (which have a tag)try
compare=and
though it’s used for categories and tags, may be will work for post types tooForum: Plugins
In reply to: [Custom Content Shortcode] Filtered total counthave you checked if you actually got those 6 items? Try to clone post which displays and check if the problem is only in lack of items
Also try
[loop type=moto checkbox=homepage value=true count=6 ]- This reply was modified 6 years, 2 months ago by signale.
Forum: Plugins
In reply to: [Redirection] adding to the end of the target causing not FoundBut why it’s like /?post=35%2F – try to open it – why is it
/encoded?Forum: Plugins
In reply to: [Redirection] adding to the end of the target causing not Foundopen https://aristake.smartleads.eu/tes%27t
you see it redirects to the main page? And it’s configured for the /?post=35/
Forum: Plugins
In reply to: [Redirection] adding to the end of the target causing not Foundok, so I’ve noticed that when I remove
/from the target it works ok, though I’ve tried with and without the flagIgnore trailing slashes (i.e. /exciting-post/ will match /exciting-post)
Forum: Plugins
In reply to: [Redirection] adding to the end of the target causing not FoundForum: Plugins
In reply to: [Redirection] adding to the end of the target causing not Foundnow it displays the url if you scroll down, but its’ done through the code. I mean when I redirect from the Blog page intending it would directly to the /?post=35 – it would do this /?post=35%2F and redirect to the home
Forum: Plugins
In reply to: [Redirection] adding to the end of the target causing not FoundForum: Plugins
In reply to: [Permalink Manager Lite] Literally () symbols and ‘ as they areoh, forgot to mention, my native slug in WordPress looks like test%282%29 which later translates into test(2)
- This reply was modified 6 years, 2 months ago by signale.
Forum: Plugins
In reply to: [Permalink Manager Lite] Literally () symbols and ‘ as they areYou can check here:
http://agency.smartleads.eu/the test post works as default, then the test2 – decodes and the most important part, although it doesn’t redirect to the raw version (which is good for the old browsers), it still knows the urls, plus for some reason AddThis takes that native slug generated dynamically – isn’t that magic?
Forum: Plugins
In reply to: [Permalink Manager Lite] Literally () symbols and ‘ as they areHi again. This time I’m contributing and saving someone’s life in the future π
So I actually managed to accomplish needed effect. And somehow it all fell in such way that even old browsers will be able to process it.
So what I did was:
1. Deactivate all Custom Permalinks plugins as for some reason they just don’t seem to influence on a native slug.
2. Next I’ve just addedif(strpos($permalink,'%28')!== false) $permalink = urldecode($permalink);which checks if the permalink contains encoding and decodes it if it does.
3. The same logic used for other symbols (like $)And this code must be implemented in the
post_linkfilter.The entire code in a proper form for those in need
function bis_post_permalinks($permalink, $post) { if(!empty($post->post_type) && $post->post_type == 'post' && is_single()) { $home_url = trim(get_home_url(), '/'); // Old format if(strtotime($post->post_date) < strtotime('2020-02-15')) { $permalink = add_query_arg('post', $post->ID, $home_url); } // New format else { $permalink = sprintf('%s/post/%s', $home_url, $post->post_name); if(strpos($permalink,'%28')!== false) $permalink = urldecode($permalink); } } return $permalink; } add_filter('post_link', 'bis_post_permalinks', 9999, 2);Remember it’s a custom case, all you need – the part with filter and strpos.
This exact code won’t work, unless you set
add_action('init', 'set_new_tag'); function set_new_tag(){ if(!empty($_GET['post']) && is_numeric($_GET['post'])) { $_GET['p'] = (int) $_GET['post']; } }in the beginning of functions.php
In fact for some ordinary use you just do:
function bis_post_permalinks($permalink, $post) { if(strpos($permalink,'%28')!== false) $permalink = urldecode($permalink); return $permalink; } add_filter('post_link', 'bis_post_permalinks', 9999, 2);Forum: Plugins
In reply to: [Permalink Manager Lite] Literally () symbols and ‘ as they areOkay, I see, thanks anyways!
Forum: Plugins
In reply to: [Permalink Manager Lite] Literally () symbols and ‘ as they areHello, Maciej.
Thanks for the help.
You’re right I’ve chosen the urldecode route and it lead nowhere.
I’ve used the code and was able to make some progress. Thus I managed to display brackets(). But I noticed that it didn’t influence the way it outputs the url for the loop instances – on the Blog page brackets still are encoded. (I placed the code globally – not conditioned them just for the single post). Plus, what’s even worse – when I click to share – it shows the slug without the brackets at all – which means AddThis is not able to see brackets and perceives it as a different url from the original.
The first post here:
http://agency.smartleads.eu/
it opens like http://agency.smartleads.eu/post/te%28st%29/
Though it shows ok as http://agency.smartleads.eu/post/te(st)/ if you try to open it directlyAnd another issue the
'symbol still refuses to be processed correctly. I need it as %27 and it just trims itself and gives http://agency.smartleads.eu/post/test%5C%272/ instead of http://agency.smartleads.eu/post/test%272/ (test2 post)If I use urldecode, still trying to share shows the url without special characters at all. And although the issue with the brackets on the loop resolve itself, the
'symbol shows as it is – not encoded %27So, why is it happening, why
'acts so inconsistently, why it can’t be just ordinary be encoded and gives spare codes? And how to make the url globally visible, so AddThis gets Permalink and sees the brackets version? Thanks a lot.Forum: Plugins
In reply to: [Permalink Manager Lite] Changing the default WordPress permalink settingsEternal gratitude to you. I’m aware of the help you gave me and, please, if you provide paid support – I will be more then happy to send you the payment.
Just correct me please if I’m wrong as I’m not a coder and only a designer, so I’m doing it intuitively
I’ve translated this part
the easiest way to use βinitβ action hook
into this code:
add_action('init', 'set_new_tag'); function set_new_tag(){ if(!empty($_GET['post']) && is_numeric($_GET['post'])) { $_GET['p'] = (int) $_GET['post']; } }but I’m afraid this part
before WordPress starts to parse the posts query
is not totally clear to me. I’ve inserted it into the beginning of the functions.php and it works great, though if I missed some condition checking, will be great full to know which. Sorry to bother, I’m sure you got enough orders with such brilliant knowledge, just please have mercy π
Forum: Plugins
In reply to: [Permalink Manager Lite] Changing the default WordPress permalink settingsthanks, Maciej.
Technically it does the trick, but, mm, I mean, is it possible to have the post work on this url too, cause you see, when opening http://agency.smartleads.eu/?post=40 – it doesn’t see it.
I mean WordPress doesn’t know this “post” tag is equals to “p”