semperaye
Forum Replies Created
-
– On what page is your shortcode [businessdirectory]? /directory
– are there any other pages with this shortcode? no unless BDP put it on it’s own hidden /sample-page because I had the shortcode on the front page originally and at that time the /sample-page had already been permanently deleted.
– Have you flushed you server and browser caches after the recent change from the other thread? Yes. Many times.
– Have you tried refreshing the permalinks as well? (Visit the Permalinks section of your admin dashboard, make any change, save it, undo the change. Save it again. And then flush the cache) Just tried that…twice…followed by a flush of all cache server and browser, it didn’t fix the problem.
Ya I think it’s an artifact of the old setup. https://businessdirectoryplugin.com/sample-page is not found so it must be only created if the shortcode is put on the front page. If BDP is creating a /sample-page for use with the plugin because I put the code on my home page like you guys said it does, then were is this /sample-page stored since it’s not in my wp pages? Can I delete it via the database somehow? Maybe delete the plugin the reinstall it? If I delete it will the database be deleted too? Suggestions?
Thanks!
FYI: creating an actual /sample-page my wordpress is not possible, it will change itself to /sample-page2 because the BDP plugin has already created that page in the background somehow. So whats the best option, robots.txt? or can this be disabled? I would highly recommend an update to this plugin to solve this.
Forum: Fixing WordPress
In reply to: Rogue “/Sample-Page” Can’t be Deleted?Nope its not cache. Looks like its caused by a plugin. Will contact them and post back here if there is a solution or if its not the plugin after all.
^Yup. Thats what it was. The plugin doesn’t like being on the front page because there is no /slug. Solved it by creating a /directory page and putting the code there.
Thank you for the reply. I only have the shortcode on my home page (front page), I do not even have a /sample-page. I mean…there was one when I installed wp, but I deleted it right away, and it’s been deleted and emptied from the trash for some time.
Maybe the bug is that the plugin doesn’t know how to be placed on the front page of a site, so it links to the sample page by default?
Hi. I’m using the very latest of both WP and BD as of today. I don’t think a screenshot is necessary. There is only one “Directory” button, and when you click it, it loads yoursiteurl.com/sample-page despite the fact that I have the shortcode on my home page and no /sample-page exists in my lists of pages.
I’ve just tested out the demo site and it doesn’t have this bug, the directory button loads business-directory/….. so I guess this is not intended behavior? I do not wish to list my site here but I’d be happy to email it to you if it’s needed.
Thank you!
- This reply was modified 7 years, 9 months ago by semperaye.
That method isn’t working 🙁
Forum: Developing with WordPress
In reply to: Help Creating a Post Category Shortcodebcworks,
The plugin author got it to work! Here is what we used:
add_shortcode( 'sa_post_cats', function () { $cats = wp_get_post_categories( get_the_ID(), array( 'fields' => 'all' ) ); $html = array(); foreach ( $cats as $cat ) { $html[] = sprintf( '<a class="sa-cat-links" href="%s">%s</a>', get_term_link( $cat, 'category' ), $cat->name ); } return implode( $html, ', ' ); } );Hope this helps someone else. Thank you for all your assistance with this!
Forum: Plugins
In reply to: [Code Snippets] Error 500Shea,
THANK YOU!! This works perfectly! I wonder what the issue was??!
Forum: Plugins
In reply to: [Code Snippets] Error 500Thank your taking a look into this for me! Unfortunately your suggested change in code did not fix the error 500.
Forum: Developing with WordPress
In reply to: Help Creating a Post Category Shortcodeadd_shortcode('sa_post_cats', 'sa_show_cats'); function sa_show_cats() { $cats = wp_get_post_categories( get_the_ID(), ['fields'=>'all',]); $html = array(); foreach ( $cats as $cat ) { $url = site_url("/category/{$cat->slug}/"); $html[] = "<a class=\"sa-cat-links\" href=\"$url\">{$cat->name}</a>"; } return implode( $html, ', '); }Thats the code I’m working with using the short code [sa_post_cats]. Is my code correct? I checked it many times…..
The snippets plugin author advised that I:
“Try switching line 3 with this:
$cats = wp_get_post_categories( get_the_ID(), array( ‘fields’ => ‘all’ ) );”
But that didn’t solve the error 500 either. I guess I may need to hire a freelancer to take a closer look to get this to work. I’ll be sure to comment back my findings.
Forum: Developing with WordPress
In reply to: Help Creating a Post Category ShortcodeHi. Thank you for looking into this for me. I tried your suggestion but that didn’t help. Error 500 again 🙁
Forum: Developing with WordPress
In reply to: Help Creating a Post Category ShortcodeNow I have another error 500 🙁 Sigh. lol…
I’ve contacted plugin support.
Forum: Developing with WordPress
In reply to: Help Creating a Post Category ShortcodeHello again! Thank you for your continued support with this 🙂 I’ll certainly look into a custom site plugin at some point. In regard to the newly corrected code, I’m getting the following error:
“The snippet has been deactivated due to an error on line 4:
syntax error, unexpected ‘$html’ (T_VARIABLE)”
I’m certainly not going to try anything here in case I break something, I’ll wait for your reply 😛 Thanx!
Forum: Developing with WordPress
In reply to: Help Creating a Post Category ShortcodeI’ve got it back up. They had a server image from the 9th, they don’t normally restore for customers but they did for me thank god. I’m going to focus on getting the site back to how it was (the custom css seems to be bugged) then back it up before I try this again.