The situation
A customer has a website made in WordPress for selling houses. When designing the website they made a 'te-koop' (for-sale) post type with dummy items for testing.
So now in the sidebar (backend) I see this:
Post type in sidemenu in backoffice
On the front the main page uses /themes/THEMENAME/archive-te-koop.php
and the detail pages are using /themes/THEMENAME/single-te-koop.php
This all worked fine and I understand how this works.
But now I have to implement data from an API that contains all different houses etc. I can use a custom plugin that generates the shortcodes I need. I have already installed and activated it and used the shortcodes on the homepage.
So then I started editing the archive-te-koop.php file and used do_shortcode() to call the overview of all houses, which works perfectly. And I can surf to using the link: https://DOMAINNAME/te-koop
The problem
I now want to edit the single-te-koop.php page for the details of the houses. The problem is that I can only go the detailpages of the dummy items because of the %post-name% being used. (https://DOMAIN/te-koop/%post-name%)
How can I make this work so I can remove the dummy items and then call the API shortcodes in the single-te-koop.php file?
I think the problem is the is_singular() function which results in false if there is not an item in de backoffice.
I really hope someone can help me on my way
Related
I am building an online store with wordpress+wocommerce. What I want to do is , once I am done with the all customization and publish the site, I no longer need the word press tools. The owner of the site is only interested in the data presented by wocommerce such as daily sales, visits etc. But the wordpress administration page is complex and complicated. So the question is, is it possible to remove all other stuff and just keep wocommerce for the client?
WooCommerce is a Wordpress plugin, so no, you can't run it without Wordpress. If your goal is to make the backoffice simple to your client, you can strip all the unnecessary menu items from the sidebar, so he only sees the WooCommerce options. Take a look at this reference.
For example, to remove the Plugins item, in the theme's functions.php add:
add_action("admin_menu", "remove_items");
function remove_items() {
remove_menu_page("plugins.php");
}
I use Elementor page builder on my WordPress site. There is a problem with it - by default it doesn't allow editing WooCoomerce Shop/Products pages. The solution they say is to add to page templates code. I, being a beginner with no idea of coding, cannot figure out which file to add this code to and where in that file. I have been researching and trying to fix this myself for two weeks now, in vain. Please help me achieve this.
Here's what Elementor say: "Sorry, the content area was not found in your page. You must call the_content function in the current template, in order for Elementor to work on this page."
Go to Elementor setting and then check products in post types
Go to Products, click Edit on the product you want to edit, input something (ie. a full stop-sign '.') in the WP Editor, click Update. (See attached screenshot.)
Screenshot
There seems to be a misconception that Elementor can be used to "edit" any content.
For Elementor to work on a "Page" i.e. the post type that uses either the page.php or any theme declared page templates it requires the_content(); function to present in the code.
Issue #1: WooCommerce uses the woocommerce_content(); function to return the content of the shop.
Issue #2: The Shop output does not use the "Page" or Custom Page template - the output is equivalent to the index.php or home.php, neither of which are editable via Elementor.
Unless you are willing to write a pretty sophisticated function to collect all those elements' data and filter them into the_content(); function, there is currently no way of editing such content directly.
I know it's not the solution you are looking for but that is the current state of affairs. Having said that, some of us are working on all sorts of solutions and maybe, just maybe - we'll come up with a way to have this option available soon ;)
For shop page you should go to Elementor setting and then check products in post types.
Because shop page products are not the content but posts it's the solution.
So inlcude products in post types and edit with elmentor, if for some reason you can't see 'edit with elementor' under shop page, then just open shop page and add
/?elementor and it would enable elementor
NO need to add this code in any page follow these instruction.
You just need to clear cache and cookies your browser, Some time website take previous data to show the web page and give this error.
or
if you open your website private mode then login and go to the page by Elementor you will never face this problem.
I'm currently developing a one page website using Wordpress and a custom theme and I'm struggling to understand how I can integrate WooCommerce checkout (and WooCommerce Booking plugin) on my index page, which contains everything rather than using /shop/ etc.
Is that even doable?
The website can be seen here: http://a-maze-in.com but the booking section is empty for now (it's live)
Any insight deeply appreciated.
Cheers.
[edit]
To be more specific, my question would be: How can I handle every step of the shop and checkout process on a single page? (that would be my index)
[/edit]
Turns out that my main problem was wp_footer(); missing from the footer.php page on my Custom theme. That little thing wasn't trigging the WooCommerce functionalities (and more specifically the functionnalities linked to the Bookings Plugin)
I've amended that and now it's working on my page. I still have a lot to figure out (like how can I do the checkout on that same page) but now I can work with that.
I am working on news system not integrated with opencart admin panel (I dont need this), but I want to display data on my custom opencart page, which is using template.
I made php script which display my news from other database, but I have not idea where to put this.
In few word - I want to execute my own script only on one opencart page (for example in custom page created in information).
I found solution at opencart forum :) - http://forum.opencart.com/viewtopic.php?f=23&t=136937
I originally wrote my Wordpress 3.0 widget http://codex.wordpress.org/Widgets_API for editing on the widget page after it has been placed in a sidebar, which handles the updating automatically using the update() function in widget. It has grown and needs a widget admin page now so outside my widget class I added another action I found http://codex.wordpress.org/Adding_Administration_Menus to add a admin_menu, so far so good (hopefully I did it using a current API method but there didn't seem to another method in the widget.php file of WP). I created the form but I don't know how to update the widget now. I've looked through the code for widgets and I'm not sure how the update function actually works. I read that you can have options and add them to the database but if they already exist I don't want to abandon that data if there's a way to keep using it. The widget will keep two fields on the widget page and the rest will be handled on the admin page.
How do I update my widget from the admin page and have it be retrieved by the widget and can that be done in such a way that it is stored in the same place as my existing widget data using WP3.0 current widget API? If not how would I go about doing it?
The answer can be found in the "Plugin Options Starter Kit" plugin http://wordpress.org/extend/plugins/plugin-options-starter-kit/ that contains all you need to figure out how to use the settings API, adding admin menu pages and more. Can't wait to see the next update of this plugin.