WordPress.org

Ready to get started?Download WordPress

Forums

Business Directory Plugin
[resolved] Why does the single view stay on the main page ? It should be its own post (7 posts)

  1. davidjs
    Member
    Posted 7 months ago #

    When viewing a single post you are technically still on the base page where your short-code is placed. You still see the title of the page. Is there a way to get the single post to be on their own page and only show the post title. If its a custom post type it should be using a single-post_type.php but it does not. We need more control over this, please...

    http://wordpress.org/plugins/business-directory-plugin/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 7 months ago #

    Hi David,

    Sorry that you ran into an issue here--I'm not following what you mean, exactly. As a custom post type, we use a single page to control the output of the directory for ease of use. Can you explain the source of the information above? I'd be interested in sending the info to my developer if there's something we're missing, but I need to understand it better.

  3. davidjs
    Member
    Posted 6 months ago #

    I dont think its a custom post type. Lets say I create a page called directory and the main shortcode is on this page. When you click one of the listings, it takes you to a page like distributors/975/singlelistingtitle
    The page title is still Distributors even though it should be Single Listing Title. And like I said before single-post_type.php should work but it does not. Your developer may not be fallowing wordpress standards. The permalink structure is also frusterating, custom post types do not require the numbers, I dont know why the developer puts them there.

  4. businessdirectoryplugin
    Member
    Plugin Author

    Posted 6 months ago #

    Hi David,

    Since we have a single page controlling the physical output of the listings, we use the ID in the permalink to get the specific listing we are displaying. That's why it's there.

    We are following WordPress standards for custom post types, but within the needs of our plugin's abilities. I can have my developer investigate this a bit to see what is going on and how single-post_type.php is used and whether it could pertain to us or not.

  5. gjpino83
    Member
    Posted 6 months ago #

    Hello guys,

    Is there any solution to this issue yet?
    I so need to display the single post on its own page to be able to add a custom header to it. I would really love to know if a solution was found or if I need to look for another options.

    Thank! :)

    Pino

  6. businessdirectoryplugin
    Member
    Plugin Author

    Posted 6 months ago #

    Hi Pino/Dave,

    So this particular issue is a complicated one. I spoke with my developer who reminded me about our internal design choices over the years so far.

    At first, we DID support using that particular file. However, it had some pretty ugly consequences which included most users having HUGE difficulties trying to get our plugin have output that was consistent with the theme. So we had to ditch that approach and use the shortcode instead to output the content of the page in a theme template directly, which made it much easier to have that look and feel out of the box. This made 90% of the users happy, so it was the right choice at the time.

    But the result of that choice is that doing it with the single post PHP is much harder now. Here's what my developer said specifically:

    Well, custom post type templates is what we used before moving everything to a page and that's why people kept saying the listings looked bad. I kept part of the support there for people wanting to use it and it should be accessible either via the single-wpbdp_listing.php theme template or overriding businessdirectory-single.tpl.php inside the theme.

    When BD detects the businessdirectory-single.tpl.php template it stops using its own permalink mechanism (so you get the default one for custom types, just like the user wants). We also support the custom taxonomy templates via the businessdirectory-category.tpl.php template.

    I understand what the user is saying and I've tried to satisfy everyone but it is certainly impossible with the current approach WP has for custom types: since no theme is going to include templates for post types different than page or post using the default template will make things look horrible (as it did before) and using just one page for everything makes it very difficult to integrate with other plugins that expect post types to behave in a standard manner. This also removes the ability to use custom permalink structures and other stuff, just like this user said.

    The problem with using the custom templates I described above is that you'll lose a lot of things that are printed only in default templates because that's where we have control. Things like the Regions selector, for instance. I also suppose the user wants to modify how an individual listing is output (title, content, etc.) and since most of the data for a listing is stored as metadata he will have to use our Form Fields API which isn't really public.

    So there you have it.

  7. gjpino83
    Member
    Posted 6 months ago #

    Thank you very much. I appreciate your answer.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.