WillBontrager
Forum Replies Created
-
I’m sorry, but I’m unfamiliar with Ninja Kick Sliding Panel.
The tags Insert PHP uses look like shortcodes but they are not shortcodes. They are begin and end markers for PHP code. And they work only in posts and pages, not in widgets or templates.
Will
Unfortunately, I’m unprepared to help you with database connections or PHP coding.
Let me suggest this: Make a separate php page that does what you want to do with Insert PHP. Figure out how to connect to MySQL and how to use it.
When the separate php page is working the way you want it to work, then put the relevant code into your WordPress page between Insert PHP tags.
If it works in the separate php page and doesn’t work when the code is between Insert PHP tags, then perhaps I can help you.
Will
Hi Peter,
By the time the PHP code between the [insert_php] and [/insert_php] tags is run, headers have already been sent along with some content. So no redirects can happen via PHP at that point. Also no cookies can be set via PHP at that point because cookies are set in the header.
Here is more information.
Will
On line 52 of your PHP code, the PHP compiler sees a regular expression that’s too large for it to compile.
Insert PHP works by putting the PHP code found between [insert_php] and [/insert_php] tags through the PHP eval() function. I speculate that it’s possible using eval() reduces the regular expression size the PHP compiler can handle; but I don’t know it for a fact.
It may be necessary to split the regular expression into two or more expressions so the compiler can handle it.
Will
- This reply was modified 7 years, 8 months ago by WillBontrager.
Sorry, only in posts and pages. It won’t work in text widgets.
Will
Hi (love your photo).
It shouldn’t be doing that.
Verify you’re using the “Text” tab instead of the “Visual” when editing. If that’s not the reason, there may be a plugin that’s interfering; they can be tested by temporarily deactivating each in turn.
If your PHP code can run outside the WordPress environment, consider uploading them as stand-alone scripts and then using the Insert Here plugin ( https://www.willmaster.com/software/WPplugins/insert-here-wordpress-plugin.php ) to publish their output.
Will
- This reply was modified 7 years, 9 months ago by WillBontrager.
- This reply was modified 7 years, 9 months ago by WillBontrager.
Yes, works fine. Also WordPress 4.74
Will
Forum: Plugins
In reply to: [Woody code snippets - Insert Header Footer Code, AdSense Ads] php in sidebarNo, there are no plans to do so.
You’re welcome to make a PHP Code Widget. I would be interested in downloading it and seeing how you accomplished it.
Will
Hi,
I’ll need a copy of the entire post or page so I can try to duplicate the warning. If it’s not something for publishing on a public forum, use our contact form at https://www.willmaster.com/contact.php
Thank you!
Will
Those are some thorough tests, and I thank you.
Several people have reported that Insert PHP and Woocommerce don’t play nice together.
Something to try: In the while loop, populate an array. Below the while loop, use the array data to echo the links.
I hope that will work for you.
Will
The code looks OK to me and I don’t know why it publishes the URL as visible text. Strange that it does that. Something may be interfering.
The only suggestion I have is to try temporarily deactivating other plugins to see if there’s interference from there.
Will
Insert PHP should work on both secure and non-secure sites equally well – generally even if the PHP code used with Insert PHP is asked to access an HTTPS URL. The plugin otherwise makes no calls to HTTP or HTTPS.
The issue may be related to $current_user. Insert PHP can’t access variables declared outside the current code block. See
https://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitselfYour error logs may also contain a clue.
Will
Forum: Plugins
In reply to: [Woody code snippets - Insert Header Footer Code, AdSense Ads] php in sidebarUnfortunately, Insert PHP works only in posts and pages.
I don’t know how you would use PHP in the sidebar without updating the template. Maybe a search will find a plugin to do the job.
Will
Niranjan, perhaps something like this would work.
[insert_php] $UserID = /* assign user id to variable $UserID */ echo "<a href='https://www.google.com/src=$UserID'>Click here</a>"; [/insert_php]
CAUTION: I’m unsure what you mean by userid. In case you’re referring to the WordPress dashboard, please understand that anyone who is logged into the dashboard can use Insert PHP so long as it is installed and activated; thus, they can do anything PHP can do on a web page.
Will
Yes, I can understand that it would be annoying to have to remember to click the “Text” tab every time before doing an edit.
Perhaps a plugin that’s active in your WordPress is messing with you. Visual Composer and Insert PHP tend to be incompatible, for example. There may be others.
An option would be to create a stand-alone PHP script that generates the list. Then use the Insert Here plugin from
https://www.willmaster.com/software/WPplugins/insert-here-wordpress-plugin.php
to insert the script’s output directly into the page.
That’s all I can think of at the moment.
Will