Shaun Scovil
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Adding a URL to an image in the media library permanentlyThis plugin might be what you’re looking for: WP Gallery Custom Links
I haven’t used it myself, but reading the description it sounds like it would do the trick.
Forum: Fixing WordPress
In reply to: Randomizing Order of First Four Posts in a SlideshowThis should do it:
<?php $args = array( 'cat' => of_get_option( 'category_slider' ), 'posts_per_page' => of_get_option( 'postnumber_slider' ) ); $wp_query = new WP_Query( $args ); shuffle( $wp_query->posts ); ?>
This solution uses the PHP shuffle() function.
Forum: Fixing WordPress
In reply to: Parse error.. how to fix?Do you have access to the website files, either by FTP or through your web host (e.g. through
cPanel > File Manager
) ?If so, you can navigate to the
/wp-content/themes/responsive
folder and edit yourfunctions.php
. Go to line #39 and find the extra “<
” character, which is probably something like this: “<<?php
”Forum: Plugins
In reply to: [CSV to SortTable] My columns aren't aligning, ever since plugin update..Hey, sorry you’re having some trouble with my plugin. I took a look at your website and noticed the following in your theme’s
style.css
:.col2, .col3, .col4 { float:left; position:relative; } .col3 { width:280px; margin-right:60px; } .col2 { width:460px; margin-right:40px; } .col4 { width:210px; margin-right:40px; }
The plugin assigns column classes (e.g. col1, col2, col3) to each column in the table, and those columns are inadvertently being affected by your theme’s CSS.
To fix this, you could change the above CSS to this:
.col2:not(th), .col3:not(th), .col4:not(th) { float:left; position:relative; } .col3:not(th) { width:280px; margin-right:60px; } .col2:not(th) { width:460px; margin-right:40px; } .col4:not(th) { width:210px; margin-right:40px; }
That is untested, but should do the trick — assuming those .col# styles in your theme are not being used for tables elsewhere on your website.
Please let me know if that sorts things out for you, or if you require any further assistance.
Forum: Plugins
In reply to: [CSV to SortTable] Display of file URLs in IE8Awesome, thank you! Please let me know if you can get it to work, as I do not have a reliable way to test IE8.
If your solution works, I will add it to the next version of the plugin.
Forum: Plugins
In reply to: [CSV to SortTable] Modify widthAlso, you may want to add this:
table.sortable th { word-break: break-all; word-wrap: break-word; white-space: nowrap; } table.sortable .col1 { min-width: 2.6em; }
That will keep your column headers from breaking across multiple lines, and keep your first column wide enough to accommodate four-digit numbers.
Forum: Plugins
In reply to: [CSV to SortTable] Modify widthNot sure why the upgrade would have caused the problem, but I did find a solution. Go to WP-Admin > Appearance > Editor and add this line to the very bottom of your theme’s
style.css
file:table.sortable td { word-break: break-all; }
That should do the trick.
Forum: Plugins
In reply to: [CSV to SortTable] Set the Column names independentlyKeep in mind that both of these examples use column header names that are hard-coded and would be applied to ALL tables created by this plugin.
You can add conditional tags to make sure these headers are only applied on certain pages or posts, like this:
function csv_to_sorttable_add_header_row( $data ) { if ( is_page( 123 ) ) { $header_row = array( 'Column 1', 'Column 2', 'Column 3' ); array_unshift( $data, $header_row ); } elseif ( is_post( 'my-csv-data' ) { $header_row = array( 'Column A', 'Column B', 'Column C' ); array_unshift( $data, $header_row ); } return $data; } add_filter( 'csv_to_sorttable_data_array', 'csv_to_sorttable_add_header_row' );
Likewise, you could program in some dynamic table header names using custom fields, like this:
function csv_to_sorttable_add_header_row( $data ) { global $post; $cols = get_post_meta( $post->ID, 'csv-column-header' ); $header_row = array( $cols[0], $cols[1], $cols[2] ); array_unshift( $data, $header_row ); return $data; } add_filter( 'csv_to_sorttable_data_array', 'csv_to_sorttable_add_header_row' );
That example would grab the custom field values for
csv-column-header
from the current post/page, and use the first three values as column headings. (EDIT: You would probably want to check if those values were set, and have some default values if they are not!)Forum: Plugins
In reply to: [CSV to SortTable] Set the Column names independentlyYes, there is!
However, it involves adding a function to your
functions.php
file — or creating a separate plugin (if you want the functionality to persist after changing themes). This is because the plugin has no settings page, and doing that via shortcode parameters would be pretty messy.Here is a code example of how you would add a row to the CSV data array before it is parsed into an HTML table: https://gist.github.com/sscovil/5919849
If you want to make it a plugin, you could do something like this: https://gist.github.com/sscovil/5919960
Forum: Plugins
In reply to: [CSV to SortTable] Display of file URLs in IE8Hey Joe, thanks for using my plugin! I hadn’t tested the CSS against IE8, as I should have. I will look into a solution now…
Forum: Fixing WordPress
In reply to: How to modify all href and src links?Here is an alternative version of that function, which uses wp_redirect:
function my_custom_redirect() { if ( is_page( 'test' ) ) { global $wp; $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); wp_redirect( preg_replace( 'example.com', 'test.example.com', $current_url ), 301 ); exit; } } add_action( 'wp', 'my_custom_redirect' );
Forum: Plugins
In reply to: [CSV to SortTable] vers 4.1.3 table gone: "pageok" msgI have marked this issue as resolved, but please feel free to comment if you are still having trouble.
Forum: Plugins
In reply to: [CSV to SortTable] vers 4.1.3 table gone: "pageok" msgI may have found a solution here: https://bx.com.au/blog/2013/02/godaddy-hosting-pageok-message/
Viewing the page source for your
Instructors
page, I see the following:<!-- pageok --> <!-- managed by puppet --> <html> <head> </head> <body> <pre>pageok</pre> </body> </html>
…and on your home page, I see this above your DOCTYPE and opening HTML tags:
<!--23d23d4reds122wqs-->
So the problem seems to be with your hosting account, although it may be triggered by the plugin if you are attempting to access a CSV file that is located on a different domain. (I’m not sure that is correct, just a hypothesis given the limited information I am working with here.)
I would recommend following the instructions in that article, which are as follows:
1. Make sure you have the domain name set up in your hosting account
For every host entry (“A” record) that you configure in DNS, you must set the domain name up in your hosting account. To do this:
- Go to your hosting control panel
- Select “Hosted Domains”
- Add the domain or subdomain
2. Make sure the entry you created in the “Hosted Domains” section of your hosting control panel is not still pending setup.
When you add a domain to your hosting account, it can take a LONG time. Up to 24 hours, in fact. To check if yours is pending:
- Go to your hosting control panel
- Select “Hosted Domains”
- Find your entry and check its status. If its status is “pending” then you are going to see a pageok message.
Forum: Plugins
In reply to: [CSV to SortTable] vers 4.1.3 table gone: "pageok" msgHi Don,
Sorry you are having trouble. That is a very strange error message — and not one that is generated by this plugin. I suspect there is some sort of conflict, but will need more information to diagnose it.
When you deactivate the plugin, does the page display properly?
Also, what is the shortcode you are using on that page?
I will try and duplicate the error on my end when I see the URL to your CSV file, which should be in your
[shortcode]
…Forum: Fixing WordPress
In reply to: How to modify all href and src links?The method above could work in any case where the URL you want and the current URL are identical, except for the sub-domain. You would just need to change the conditional tag in the if statement.
There really isn’t an easy or good way to preg_replace every
href
andsrc
value. You’d have to write a function to change all of the enqueued script and style URLs; another to filter the content; and possibly several others. It would be a total hack.