Han
Forum Replies Created
-
Forum: Plugins
In reply to: [Shadowbox JS] Shadowbox JS does not play YouTube videoDroopie–make sure your URL query strings starts with a ? and separated by &. Here is an example of one of your video’s code:
This:
https://www.youtube.com/embed/RyfmqoHdT7M?rel=0?autoplay=1Should be:
https://www.youtube.com/embed/RyfmqoHdT7M?rel=0&autoplay=1Forum: Fixing WordPress
In reply to: 3.7.1 HTTP ErrorI think this has to do with WordPress reading media metadata (Exif, ID3 tags, etc.) and storing them into the database. WP crashes while crunching (or reading in these data).
I use NextGen Gallery plugin and received “internal server error” when crunching (creating thumbnails) for uploaded photos. It was interesting to see some photos go through successfully while others do not. I thought it was the GD library or some Apache setting causing the issue. So after a week of upgrading PHP, MySQL, GD library, etc., what I did was commented out the functions in NextGen Gallery plugin that reads in the Exif metadata, and everything went smooth afterwards.
This same concept may apply to the media library and how it reads in the uploaded files.
Forum: Fixing WordPress
In reply to: Cannot use nl2br(). How does WordPress display its content?I resolved this myself after looking harder online:
When you retrieve the post content from the database you get the unfiltered content. If you want to achieve the same output like WordPress does in its’ posts or pages then you need to apply filter to the content. You can use the following code: <?php $post_id = 26; $queried_post = get_post($post_id); $content = $queried_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
Forum: Fixing WordPress
In reply to: Questions/concerns with WordPress speed issuesThank you! I will give the P3 Profiler plugin a try. Over the weekend, I found that one of the plugin that utilized the wp_get_nav_menu_items() WP hook to create parent and child pages for navigation was taking up all the MySQL resources. We have over 750 pages and by using the hook, it queried those pages six times on every page load.
A note for those people using similar WordPress functions–these hooks are not optimized for larger websites. Create your own queries that pull in essential parts instead!
Forum: Fixing WordPress
In reply to: wp_postmeta: querying multiple meta_values from a random post_idYou are a lifesaver! Very clever way to put multiple data into one column. Thanks!
Forum: Fixing WordPress
In reply to: Disable plugin javascripts in admin, but enable on front-end only?This has been resolved.
Forum: Fixing WordPress
In reply to: Disable plugin javascripts in admin, but enable on front-end only?I got it to work! Thank you Andrew!
I didn’t realize you had wp_enqueue_scripts. I thought you had admin_enqueue_scripts (wp vs. admin). There is a difference between the two according to the API. I also took out the is_admin part because we no longer need to check for that.
function myfunction() { wp_enqueue_script('myscript', $url_to . 'myscript.js', array('jquery','jquery-ui-core')); } add_action('wp_enqueue_scripts','myfunction');
Forum: Fixing WordPress
In reply to: Disable plugin javascripts in admin, but enable on front-end only?Oops, I forgot the NOT in front of is_admin in my original post. The case still holds though. Basically, it should be saying:
“do not load the JavaScript in the admin panel, but load them on the front-end website”
I actually need it to say this:
“do not load the JavaScript in the admin panel, but load them in the front-end website (while logged in too)”
Forum: Plugins
In reply to: [Shadowbox JS] Shadowbox JS does not play YouTube videoCalling the shadowbox manually + using the embed YouTube link as follows works for now:
<a href="https://www.youtube.com/embed/ID_GOES_HERE?autoplay=1" rel="shadowbox;width=640;height=385">Watch the video</a>
But then again, you have to manually add width and height.
Forum: Fixing WordPress
In reply to: Website keeps loading infinitelyWebsite is back after removing the following from the header.php file:
<meta name=”expires” content=”Sat, 01 Jan 2000″>
I am not sure if that is related, but just after I removed that snippet, the website came back. Also, my widgets were screwed up–some had gone missing. I imagine this is due to enabling/disabling plugins. This is a very strange issue and I am tempted to say it may happen again. For now, it has been resolved.
Forum: Fixing WordPress
In reply to: Website keeps loading infinitelyThank you. I will try to retrieve the error_logs from our admins.
Forum: Fixing WordPress
In reply to: ?page_id=111 vs. ?p=111 in URLSo this makes me think, does ?page_id= go to a page while ?p= go to a post?
Forum: Fixing WordPress
In reply to: ?page_id=111 vs. ?p=111 in URLOur site has been modified to use posts for news sorted by date, hence setting the “day and name” permalink. Our website’s pages are defined in such a way when we have a page ID 111 and permalink for that page is “…/test-page”, we get to “…/test-page” when we use ?p=111 (now ?page_id=111), and vice.
It’s odd that ?p=xxx used to work.
Forum: Fixing WordPress
In reply to: ?page_id=111 vs. ?p=111 in URLForum: Fixing WordPress
In reply to: ?page_id=111 vs. ?p=111 in URLAfter changing to the “default” permalink and removing the rewrite rules from .htaccess (as recommended), the ?p does not work, and ?page_id works.