Hi @loxx927
Thanks for your detailed response. Yes, you can add plugin shortcode to any page you want. There will be no issue in that.
The correct shortcode is [purchase_history]
In case if you are getting 500 error, It means there is some functionality is breaking. You should check your error log. The error should be there which helps us to identify the issue.
Thank you for the suggestion. I have looked at my server error logs, but no errors are being logged, so whatever is causing the issue is happening before it writes something to the log I’m guessing.
Just to help clarify a bit further, I am trying to include the page at the template level,
so for example, in the single.php template (just an example), I want to include the page in the content loop:
<div class=”history-info”>
<php include(/plugins/easy-digital-downloads/templates/order-history.php); ?>
</div>
doesn’t work (produces 500 error)
nor does this
<div class=”history-info”>
<php do_shortcode([‘purchase_history’]); ?>
</div>
Also produces 500 error. So I’m stumped as to why.
Hi @loxx927
Thanks for your code. I am not sure it is a typo mistake or something but you forgot to open the PHP tag properly. It should be <?php
not <php
Please try this.
<div class="history-info">
<?php echo do_shortcode(['purchase_history']); ?>
</div>
Sorry, that was just a typo I made here. I have it properly formatted (?php) in my code and it doesn’t work.
Just gives me the aforementioned 500 error… so I’m stumped as to why I can’t pull the page into another page.
Any other thoughts?
Thanks!
-
This reply was modified 3 years, 3 months ago by loxx927.
Hi @loxx927
Hmmm… Very Strange.
Please try the below steps.
1) Create any test page.
2) In page editor put the plugin shortcode in it [purchase_history]
3) Publish the page and see it is working or not.
Let’s see this gives error or not.
Hi,
I tried your test step and this works. So that’s good. However the page I’m creating, I need to include the page in php, since my attempts to include the shortcode in the page just give a 500 error.
I am using a plugin called php everywhere to be able to add include statements to my page.
The following code works great:
<div id=”submit-ticket”>
<?php include( ‘wp-content/plugins/awesome-support/themes/default/submission.php’ ); ?>
</div>
But the following code does not work: (500 error)
<div id=”support-ticket-display”>
<?php if is_user_logged() {
include( ‘wp-content/plugins/awesome-support/themes/default/list.php’ );
} ?>
</div>
So there must be some sort of conflict on the list.php page with the main template page that doesn’t like to be included in this method. Not sure what it might be though.
Thanks for the assistance!
@loxx927
Hi there,
In your code you need to add () in the IF statemenet.
<?php if is_user_logged() {
should be
<?php if( is_user_logged() ) {