ericperson
Forum Replies Created
-
Forum: Plugins
In reply to: Going directly to posts in WP Search SuggestChanging this line:
$results[] = $post->post_title;
to something like this:
$results[] = '<a href="' . get_permalink($post->ID) . '">' . $post->post_title . '</a>';
changes each result into a link (though some of the links are messed up, I don’t know why); but hitting enter or clicking on them does nothing. Does this give you any ideas?
Forum: Plugins
In reply to: Going directly to posts in WP Search SuggestI suspect that the answer would have something to do with the javascript (wpss-search-suggest.js) as opposed to the PHP.
onSelect:function(){ $('#searchform').submit();
Instead of
$('#searchform').submit();
, something else would have to happen—something likeonSelect:function(){ window.location = ________;
where in place of ______ we get the permalink from the selected row.
Forum: Fixing WordPress
In reply to: get_template_part() doesn't load dynamic contentDoes a template part need to start with a php tag or any sort of header? My file starts with html (a
<ul>
tag).Forum: Hacks
In reply to: Passing variable into a function that is only "called" by a hook?Thanks esmi, that’s perfect (except for the “<?php” on the second line, but that was my fault). The only thing is it outputs the last comma, which breaks the CSS:
#menu-posts, #menu-links, #menu-comments, { display:none;}
In terms of best practices, what’s the best/most efficient way to remove the trailing comma? It could be done with a conditional, or with substr, like this:
substr($thelistofvalues, 0, -2);
Everything that I can think of makes the code a lot longer and harder to understand. Any suggestions?
Forum: Hacks
In reply to: Passing variable into a function that is only "called" by a hook?I am having trouble passing variables into a function I am attaching to the admin_head hook. Is there something I’m missing here? I keep getting “Invalid argument supplied for foreach()”
$array = array('posts', 'links', 'comments'); add_action('admin_head','hides_menus'); <?php function hides_menus() { ?> <style type="text/css"> <?php foreach ($array as $value) { echo '#menu-' . $value . ', '; } ?> { display:none; } </style> <?php } ?>
Or do I have to do something with classes to fix this?
Forum: Fixing WordPress
In reply to: Convert Tags to Taxonomy TagsI am looking for a tool that does this too. Moves terms from one taxonomy to another.
Forum: Plugins
In reply to: [Plugin: Subheading] show subheading only on custom post typeCan you advise what lines of subheading/index.php would need to be duplicated/added to add support for a specific custom post type? I would love to figure out how to do this, even in the absence of adding the admin options for it.
Forum: Hacks
In reply to: Duplicate MenuI would also like to know how to do this.
This problem is occurring because the plugin is specifies its folder name incorrectly, probably because of the plugin’s name change from & to and.
Go into line 22, 30, and 40 of dnd-file-uploader.php and change all instances “dnd-file-uploader” to “drag-drop-file-uploader”
For example, change this in line 22:
$dnd_fileupload_dir = plugins_url('/dnd-file-uploader/', dirname(__FILE__));
to this:
$dnd_fileupload_dir = plugins_url('/drag-drop-file-uploader/', dirname(__FILE__));
The Firebug console lists this error when the edit post page loads (WP 3.1):
jQuery(“#file_upload”).fileUploadUI is not a function
[Break On This Error] onComplete: function (event, files, index, xhr, handler) {Below is the error listed in the Firebug console. This is on a fresh install of WordPress so there must be something that needs to be fixed in the plugin code:
jQuery(“#file_upload”).fileUploadUI is not a function
[Break On This Error] onComplete: function (event, files, index, xhr, handler) {I also would vote for allowing searching by the full name (nicename) of the author. This is really important for multi-author sites where you know other authors’ names but have no idea what their usernames are.
This is the first version of Co-Authors Plus I’ve used. Is there a line of code that can be changed to re-activate full name searching (which mcstevem says was available previously)?
Forum: Plugins
In reply to: [Post Type Switcher] [Plugin: Post Type Switcher] Broken after 3.1It didn’t work for me in 3.1.1—I added the code but nothing changed. I also tried deactivating and reactivating the plugin after editing.
Is this working for anyone in 3.1.1?
Forum: Fixing WordPress
In reply to: Connecting a CPT post to a taxonomy archive pageWhat do I have to add to this query_posts() query in taxonomy-countries.php to get it to return the right country?
query_posts('post_type=country&countries=????'); while (have_posts()) : the_post(); the_content( 'Read the full post ?' ); endwhile;