Matthew Denton
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Widgets suddenly disappearedHi, I would suggest trying to re-order your widgets if the YouTube text widget is at the top/bottom of your other widgets switch them and see if the other widgets now show up. May be there is an issue with the content in the YouTube text widget that is stopping the other text widgets from rendering.
Forum: Hacks
In reply to: "Last Upated"Is .65 the latest version of the plugin? Did you update the readme file with your release? Not sure what the root cause is but I usually update the readme and meta data in the plugin main file and it picks up the change within 15 minutes (WordPress’s plugin refresh rate).
Not a Problem.
The message you see: Warning: in_array() expects parameter 2 to be array, null given in
usually occurs when a variable is initially set to null and then never further modified. I suspect that the first loop locally is never adding any entries into the $do_not_duplicate array and as such it is defined as null causing the error.To check place
$do_not_duplicate = array();
before this statement in the code$my_query = new WP_Query('category_name=portfolio&posts_per_page=2&offset=2'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate[] = $post->ID;
in the code and see if the error is gone.
Forum: Fixing WordPress
In reply to: Avatars – Where Are They?WordPress uses Gravatar.com for avatars. Sign-Up today using your admin email address and you will be all set.
Forum: Fixing WordPress
In reply to: Adding AJAX to sidebar widgetHi, I do a very similar piece of logic in my own widgets. The only difference is that i disable the fields instead of hiding them but the general principles should work. Here is the javascript code I have outputted with each widget instance.
<script type="text/javascript"> if( window.changeAmazonWidgetCarousel ) { } else { function changeAmazonWidgetCarousel( id, asin_id, keywords_id, node_id, index_id ) { var value = jQuery( "#" + id ).val(); if( value == "ASINList" ) { jQuery( "#" + asin_id ).removeAttr('disabled'); jQuery( "#" + keywords_id ).attr('disabled','disabled'); jQuery( "#" + node_id ).attr('disabled','disabled'); jQuery( "#" + index_id ).attr('disabled','disabled'); } else if ( value == "SearchAndAdd" ) { jQuery( "#" + asin_id ).attr('disabled','disabled'); jQuery( "#" + keywords_id ).removeAttr('disabled'); jQuery( "#" + node_id ).removeAttr('disabled'); jQuery( "#" + index_id ).removeAttr('disabled'); } else { jQuery( "#" + asin_id ).attr('disabled','disabled'); jQuery( "#" + keywords_id ).attr('disabled','disabled'); jQuery( "#" + node_id ).removeAttr('disabled'); jQuery( "#" + index_id ).removeAttr('disabled'); } } } jQuery( "#<?php echo $this->get_field_id('widgetType');?>").change(); </script>
In the javascript it has a check first to see if the function is defined and if it isn’t then it defines the function.
As for the actual form part I attach the function call to the onchange method of the field that will cause the javascript to run.onchange=\" changeAmazonWidgetCarousel( '" . $this->get_field_id('widgetType') . "', '" . $this->get_field_id('ASIN') . "', '" . $this->get_field_id('keywords') . "', '" . $this->get_field_id('browseNode') . "', '" . $this->get_field_id('searchIndex') . "' )\"
Let me know if you need more details but the basics are that you need to pass the field ids to the function and then using jQuery or your preferred javascript library you can modify them however you want.
P.S. this isn’t AJAX it’s simply javascript
Forum: Fixing WordPress
In reply to: PAGES / POSTSAll post/page content is stored in the ???_posts table of your database where ??? is the prefix you have configured in wp_config.php. I haven’t tried this but I believe all you need to do is change the post_type column from page to post and you will be all set.
Forum: Fixing WordPress
In reply to: customizing post title linksI’m not sure I am following what you want to do here. Are you saying that when a visitor is on your main page the blog post titles should go to the underlying blog post. But then when on the blog post itself the same title should go to a remote site?
If so you may want to rethink this as it is bound to confuse your visitors. If the title is of the current post you are on it shouldn’t drive visitors to external articles. Instead you should have a link in the content or a callout element to drive visitors to remote articles.
Hi does your local version have the same content as your online version? One quick way to correct this may be to simply instantiate $do_not_duplicate outside of the while loop as an empty array
$do_not_duplicate = array()
Forum: Fixing WordPress
In reply to: add action / function does the order matter?You are correct. You can place add_action before or after you define the function.
Forum: Fixing WordPress
In reply to: how to remove widget bar on certain pageYou could do this in a few different ways.
1) create a new page template in your theme that doesn’t have the sidebar, and set your page to use that template
2) modify the sidebar so it doesn’t get shown if the current page’s id = x
Forum: Fixing WordPress
In reply to: Removing the Edit This Entry LinkThe Edit link should only be displayed to logged in users. A normal visitor would never see this link, however if you want to remove it all together look for the edit_post_link method in your theme’s files and remove every instance of it.
For example in theme twentyten you would remove this line:
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
Forum: Fixing WordPress
In reply to: if elseif for custom fieldHi:
The issue you have is that $key is always equal to “banner” and so if not on the fornt page it will always resolve to the elseif statement.
You need to check the return value of get_post_meta. If not empty then echo the meta content.
<?php $key="banner"; if (is_front_page()) { echo "<object width='685' height='255'><param name='movie' value='../wp-content/themes/PPS2010/images/perimeterplasticsurgery2.swf' /><param name='quality' value='high' /><embed src='../wp-content/themes/PPS2010/images/perimeterplasticsurgery2.swf' quality='high' pluginspage='https://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='685' height='255'></embed>'</object>"; } elseif (get_post_meta($post->ID, $key, true) != "") { echo get_post_meta($post->ID, $key, true); } else { echo "<img src='../wp-content/themes/PPS2010/images/flashholder.jpg' />"; } ?>
Forum: Fixing WordPress
In reply to: Page deleted but still on nav menuMore information would be needed to debug this as it could be an issue with a theme or plugin. I would suggest to start off go in the Appearance > Menus option and see if your site makes use of WordPress’s custom menus. If so make sure the page link isn’t present.
Forum: Fixing WordPress
In reply to: How to Remove 'Post Details' From My BlogYou need to modify the theme you are using to make your desired changes. You may need to modify multiple files including but not limited to: wp-loops.php, single.php and page.php.
The code you will want to remove most likely looks similar to:
<div class="post-info"> <?php if(!is_page()) : ?> <span class="setting user"><?php echo the_author() ? '' : 'Unknown'; ?></span> <span class="setting datetime"><?php the_time('F d, Y'); ?></span> <?php endif; ?> </div>
Forum: Fixing WordPress
In reply to: Profile Photo?The images you are seeing are gravatars. If you want to have your own image display next to your comments you can register your admin email address at gravatarcom. Once registered simply upload a picture of your choice and now when you comment on your website or other wordpress websites your image will be shown.