latin_l3oi
Forum Replies Created
-
Forum: Hacks
In reply to: Get ID of custom post type within nested shortcodesJust adding a bit of the code I’ve used:
Activity Shortcode:
function display_activity($atts, $content = null){ $a = shortcode_atts( array( 'id' => null, ), $atts ) ; if (!is_null($a['id'])){ $activityId = intval($a['id']); if (is_int($activityId) && $activityId > 0){ $activityObj = get_post($activityId); $theTitle = sanitize_post_field( 'post_title', $activityObj->post_title, $activityId, 'display' ); $theContent = apply_filters('the_content', $activityObj->post_content); $html = "<div id='sbusuws-activity-" . $activityId . "' class='sbusuws-activity'>"; $html .= "<h3 class='sbusuws-activity-title'>" . $theTitle . "</h3>"; $html .= "<div class='sbusuws-activity-content'>"; $html .= do_shortcode($theContent); $html .= "</div>"; $html .= "</div>"; return $html; } } }
Textarea Shortcode:
function display_textarea($atts){ $activityId = ""; // <--- This is the problem $textareaId = $activityId . "-sbusuws-activity-textarea"; $html = "<textarea id='" . $textareaId . "' rows='5' cols='20'>"; return $html; }
The idea was to make the textarea shortcode as simple as possible, ie: [textarea]
Hello,
Just to update, my problem is now solved.
Here is the response I got from my web host:
I have fixed up a reference to *.mainsite.com.au that was a server alias in the someotherdomain account and have now moved this to the mainsite account. It would be best if you could move the files back and try again. If this does not help the problem, it likely confirms the problem is within WordPress itself. As such, I will not be able to assist any further, as manage everything up to your code (but not including).
I guess it was a server side issue and not a WordPress issue.
Thank you Ipstenu for helping me solve this problem. I really appreciate it. ??
Thank you for your advice Ipstenu!
I moved everything under “public_html” to a new directory I created “WP_Backup” and when I visited the site: mainsite.com.au, I got a “Test page for Apache HTTP Server”, so I assume WordPress is no longer running, but when I went to sub1.mainsite.com.au/wp-admin, it still took me to https://www.someotherdomain.com.au/wp-login.php?redirect_to=http%3A%2F%2Fsub1.mainsite.com.au%2Fwp-admin%2F&reauth=1
So I guess this means it’s not a WordPress issue and rather a server redirect / rewrite issue.
Thanks for that. Hopefully now my web host can fix the problem. ??
Hi Ipstenu,
Thank you for taking the time to read and reply to my query.
Well, basically “someotherdomain.com.au” is a WordPress installation which I asked my web host to setup several weeks back.
“mainsite.com.au” I believe is a separate instance of WordPress on the same server setup by my web host just last week.
Below are bits of the emails I received from my Web Host’s Systems Administrator:
“It’s possible to set up a wildcard DNS entry so all subdomains point towards your server. Then, if the multi-site configuration is able to dynamically handle additional sites, you would be free to scale up sites yourself.”
And once it was setup, he said:
I’ve registered your domain, created the account and database, downloaded and configured wordpress, added in DNS records and a wildcard CNAME for *.mainsite.com.au to MyServerName.
Please let us know if you encounter any issues.
Note: I’m replacing my actual domain with “mainsite.com.au” and actual server name with “MyServerName”.
After that multisite didn’t work at first, so I thought it may be that the Wildcard DNS wasn’t configured, which he replied:
You were correct on that assumption. I had added it for one of your other domains, but have now had it added to mainsite.com.au. Please give it a couple of moments and attempt to load the sites again.
After that change, the page loaded but with only a message saying “MyServerName OK”, instead of the sub domains which I created within the Multisite dashboard. He then replied:
I’ve added in a wildcard subdomain as a ServerAlias and I can now see sites loading.
After that, multisite started working except for the issue that I’m having now which is that I can’t access the admin dashboard of the sub sites (sub1.mainsite.com.au and sub2.mainsite.com.au).
I received this email from my web host:
I cannot see any server-side redirects on the account. Considering you were provisioned a fresh database and the rewrite is likely within your application, this is not something I am able to help with. You may like to perform some research to see why this could be happening, as we do not manage your application.
Sorry for the very long reply, but I’m not too experienced with server redirects and rewrites and I’m not sure what to do next to get multisite to work.
In regards to:
it sounds like that site’s being honored first in so far as wildcards go, and you may need to park each subdomain manually.
What can I ask my web host so this can be accomplished? The web hosting provider does not support cpanel or plesk.
Any suggestions would be extremely helpful.
Thank you for your time.