Travis Smith
Forum Replies Created
-
Forum: Hacks
In reply to: How to work out the feed type that the_content/the_excerpt is being invoked in?Gary,
You cannot determine the context from
the_content
filter beyond what the basic conditional functions provide. Even those likeis_page_template
technically doesn’t work inside the loop (the workaround is to create ownis_mycustom_template()
to return whatever boolean based on a global that can be set atget_header
or even thewp
hooks).Now,
is_feed()
helps a ton. It can provide you a bail or an early return within your filtering ofthe_content
:add_filter( 'the_content', 'prefix_the_content_filter' ); /** * Filter the_content except for Feeds * * @param string $content Post content * @return string $content Maybe modified post content */ function prefix_the_content_filter( $content ) { If ( true === is_feed() ) return $content; // do something for non-feeds return $content; }
Then you would hook into
the_content_feed
. Similarly, forthe_excerpt
, you would hook intothe_excerpt_rss
.add_filter( 'the_content_feed', 'prefix_the_content_feed_filter', 10, 2 ); /** * Filter the_content for Feeds * * @param string $content Post content * @param string $feed_type Feed type: rss, rss2, atom, rdf * @return string $content Modified post content */ function prefix_the_content_feed_filter( $content, $feed_type ) { // do something for feeds content return $content; }
Some others of interest are:
- comment_author_rss
- comment_text_rss
- the_category_rss
- rss_enclosure
- atom_enclosure
- feed_content_type
- the_title_rss
- wp_title_rss & get_wp_title_rss
- bloginfo_rss & get_bloginfo_rss
These should get you on your way!
Forum: Plugins
In reply to: [Genesis Latest Tweets] Open a new windowI will build this in the next release for you.
Forum: Plugins
In reply to: [Genesis Latest Tweets] The Twitter API returned an errorThank you for your feedback.
Yes, there are two potential problems that affect this. I will be addressing them this next week.
Forum: Reviews
In reply to: [Shopp Importer] Breaks Cart CheckoutAgain, this is a security risk. The goal of the plugin is to import. Not to remain activated. So activate. Import. Deactivate.
Forum: Plugins
In reply to: [Shopp Importer] Breaks Cart CheckoutWell, you are not supposed to keep this plugin active. Activate. Import. Deactivate. It’s a security risk otherwise.
Forum: Plugins
In reply to: [Shopp Importer] Does This Work With Shopp 1.2.# seriesYes, but it’s functionality extent entirely depends on the host and execution time. I’ve had the range of experiences from importing on 25 at a time to importing 2,000 at a time.
Forum: Plugins
In reply to: [Genesis Featured Images] Incorrect usage of wpdb->prepareHello Mr. Papa,
I believe I have fixed this. Please let me know if I didn’t.
Thanks,
Travis
Forum: Plugins
In reply to: [Genesis Custom Post Types Archives] Post meta syntax for custom post typesHello Peter,
The post_terms shortcode (see here) is actually a potential Genesis issue. Please post that to the StudioPress forums and link to it here. If you email me the link I will join the conversation there.
Thanks,
Travis
Hello Jackama,
Are you using the Original Image in the Featured Images Settings box? If not, then it won’t work simply because of the way WP works. If possible send a screen shot of the settings.
Thanks,
Travis
Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy ArchiveMoving this to Shopp forums.
Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy ArchiveA better example may be this:
Lucent Accessories: https://lordsnet.staging.wpengine.com/?shopp_manufacturer=lucent&shopp_category=accessories (add &debug as needed)Cisco Accessories: https://lordsnet.staging.wpengine.com/?shopp_manufacturer=cisco&shopp_category=accessories (add &debug as needed)
Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy Archivenacin, any idea why https://lordsnet.staging.wpengine.com/?shopp_manufacturer=cisco&shopp_category=adapter-card (add &debug to see the main query) has *posts* (rather products) where shopp_manufacturer is NOT cisco? This page should have no posts, but it shows posts as though the URL is https://lordsnet.staging.wpengine.com/?shopp_manufacturer=lucent&shopp_category=adapter-card ??
Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy ArchiveNacin, no I tried that. I believe the issue was that the query had run already and the queried object wasn’t what was needed. It was as if
parse_query
was too late or something…This is on a stage and I don’t mind sharing if you’d like to run some tests or something?Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy ArchiveOf course, if the search parameter is empty I could use template_redirect to the taxonomy archive. That solves it!
add_action( 'template_redirect', 'lordsnet_empty_search_redirect', 1 ); function lordsnet_empty_search_redirect() { if ( isset( $_GET['pw-search'] ) && isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { $qvs = array(); foreach( $_GET as $param => $value ) { if ( 'pw-search' != $param && 's' != $param && 's_cs' != $param ) $qvs[$param] = $value; } $url = add_query_arg( $qvs, home_url() ); wp_redirect( $url ); exit; } }
Forum: Fixing WordPress
In reply to: Advanced Search to Taxonomy ArchiveTo be a bit more clear: I’d like for a user to be able to search without using a keyword. Thus changing the search from https://lordsnet.staging.wpengine.com/?shopp_manufacturer=lucent&shopp_machine_family=0&shopp_category=forwarding-media&s=&pw-search=advanced-search&s_cs=true to https://lordsnet.staging.wpengine.com/?shopp_manufacturer=lucent&shopp_machine_family=0&shopp_category=forwarding-media