• The_elephant

    (@the_elephant)


    Hi,

    I’m having issues when deleting a post.

    Deleting a post however does work, but the result in the overview page is several filled posts (according to the template) and one ’empty’ template post.

    When i switch off custom layouts then the ’empty’ post is not there anymore so i guess this might be a bug in Custom Template (or at least a free feature which i guess is not wanted by many happy users of the plugin.

    Hope you are able to fix this in the upcoming release. If you need more info, happy too elaborate.

    (result of this issue can be found on the page i have shared as url. At this moment it is the first post on that page).

    Cheers,

    The elephant

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hey “The elephant”!

    That sounds like a bug! Thanks for sharing… I’ll take a look later on today / tomorrow and see if its something we need to fix.

    We cache our list of posts (so they load quicker) and it seems we’re not detecting properly when the post is deleted…

    For now, you can disable our caching mechanism by adding this to your wp-config.php file:

    define( 'CUSTOM_LAYOUTS_DEBUG', true );

    In the future I would not use this is a workaround, but right now, the ONLY thing that does is disable our cache which will resolve your issue.

    I’ll update as soon as I know more.

    Thanks

    Thread Starter The_elephant

    (@the_elephant)

    Hi,

    Thanks for the workaround.
    As the post mentioned is on page 2 I don’t feel the need to implement the workaround. However I do am looking forward to the fix.

    Glad I could help this way to make the plugin even better ??. Will that fix also delete my already deleted post?

    Plugin Author Code Amp

    (@codeamp)

    Hey The Elephant

    Been a bit sidetracked but should be able to test this shortly.

    Hoping its reproducible so I can apply a fix. I’ll know more in a few hours time.

    Best

    Plugin Author Code Amp

    (@codeamp)

    Hi again!

    So I took a look into this, and turns out we did some logic on both delete_post and trash_post (hooks WordPress fires when these actions are carried out).

    That means we should be showing the correct results.

    Did you by any chance delete posts in any other way than the usual way via WordPress admin? (I’m guessing you didn’t)

    I checked your site again, and I see that the missing post is no longer there.. I’m assuming the problem is not fixed though?

    This might need some further debugging (disabling plugins / theme etc, on a staging site ideally) – happy to walk you through it.

    Thanks

    Thread Starter The_elephant

    (@the_elephant)

    Hi,

    Yesterday i saw that the message was gone. It might be because of the caching plugin i? using (nitropack). I have purged that cache completely. Its a hard cache.

    I′m however not sure if that did the trick because i work a lot on the site. I saw it myself yesterday that the blog-post was gone.
    For now you can mark this as solved as i cannot reproduce it / problem is gone.

    I have one other (offtopic) question. Is there a way to place Google Ads in between the blogpost? I found a workaround myself (as you can see on the website) but then i cannot select a position (i create a new post and misuse that location for placing an ad. Idealy i would like to be able to place it in between posts. Might this be related to “custom Layout”-plugin or do you have any idea how to make this possible?

    Thanks for your help! Much appriciated.

    The Elephant.

    Plugin Author Code Amp

    (@codeamp)

    Glad you’re not seeing the issue for now, do let me know if it comes up again!

    Regarding inserting (ad) content… that’s a very interesting idea! So you would want it to repeat every X amount of results?

    Right now I can’t think of a way to do it reliably (because a lot would depend on how its sorted).

    I think we’d need to find a way to inject this within the plugin itself.

    I’m thinking out loud here, but would this help?

    function cl_template_after_render( $settings ) {
    	// Do something after the render
    }
    
    add_action( 'custom-layouts/template/after_render', 'cl_template_after_render', 10 );

    Taken from here:
    https://customlayouts.com/documentation/action-filter-reference/

    I think this might not quite work as it might still be inside the layout container…
    Would it help if we fired an action after we rendered an complete item in a layout?
    – this would be after the template and its container – which means I think you could could add your own custom elements.

    Something like ‘custom-layouts/layout/item/after_render’..?

    Best

    • This reply was modified 2 years, 12 months ago by Code Amp.
    Thread Starter The_elephant

    (@the_elephant)

    Hi,

    You lost me there as i am not a developer ??.

    Idea is that i’m able to point it into a dedicated location. For example:
    Ad after post 2
    Ad after post 5
    Ad after post 8
    (or other nummers)

    Think it must be injected in the plugin indeed. I’m not able to put anything in between posts at this moment (you can think of Ads, top5 best Read, a call to action, Photoshop, etc.).

    Is this something you can make ‘custom layout’ even better with / willing to built?

    ??????

    Plugin Author Code Amp

    (@codeamp)

    Ahhh, you’re creative work around led me to believe you were a developer ??

    So yeah, I’m going to put this on the to do list – but to warn you, this will need to built after a bunch of other things on roadmap, so might not be for a little while yet…

    First thing is a big update coming early next year, then we we will plan out some more features to tick off.

    Thanks

    Thread Starter The_elephant

    (@the_elephant)

    Yeah i’m a creative dude ?? Never give up before i find a descent work-around.

    Your plan sounds great. in the meantime i’ll keep searching for the best fit for my current issue ofcourse! Hope one day it will be possible via your plugin.

    Thanks upfront and keep up the good work!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Deleting a post will result in showing the blanc template’ is closed to new replies.