Jump to content

the_toolman

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by the_toolman

  1. Thanks for the reply. I have also seen that I can reorder them by going to Structure > and then click reorder and it seems to have save the order.
  2. Hi, Thanks for the reply. So If I were to use the second method, I would use the following: SELECT firstname , lastname , email FROM tests.wp_d8zma; (my table is called tests and the database called wp_d8zma Will this keep the order each time I log into phpmyadmin? Thanks!
  3. Hi there, Is it possible to reorder columns in phpmyadmin and have them remain in that place next time I visit? At the moment, I can drag and re-order them, but when I log back into phpmyadmin, they are reset. Does anyone know if this is possible? Maybe there is a query I can run? Thanks!
  4. Hi there, I am trying to wrap some content in a div, but when I render it, it is outputting the actual HTML. This is the line I have: add_filter( 'woocommerce_product_description_heading', 'rename_product_description_heading', 10, 1 ); function rename_product_description_heading( $heading ) { return __( '<div class="myclass">Additional Information</div>', 'woocommerce' ); } which is outputting: <div class="myclass">Additional Information</div> rather than wrapping it in the div. Can anyone help me with wrapping the "Additional Information" text in a div? Thank you :)
  5. Hi there, I am trying to write a simple piece of code that will display a little text phrase on every Friday 13th in any year. How would I best go about doing this? Thank you.
  6. I did ask on their forum under general chit chat and they said it has been there a long time with custom setup and development. It was mainly the design and usability that I liked, so wondered if it was based on an existing script.
  7. Hi, Thanks for the reply and the link to the interview, very useful! Yes I saw all the tracking info when looking at builtwith.com. I'll keep digging
  8. Hi there, I'm wondering if anyone can tell me a way to find out what software this forum is using: https://www.englishforums.com/English/ I've tried looking at the source, but can't find much. Are there any tools out there that can scan the website for software used? Thanks
  9. Sorry, that last line wasn't meant to be there... that we me trying to replace the comma with "nothing" to remove it. $category_name = str_replace( ',', '', $cat_name);
  10. Thanks for the reply. I ended up with this code to remove spaces too. I now have an issue with the category's displaying a comma in the classes, for example: <span class="movies,-film-and-tv"></span> Could anyone tell me how can I remove the comma from the string? $cat_name = $subterms->name; $amp = array('&', ' '); $and = array('and', '-'); $category_name = str_replace($amp, $and, strtolower($cat_name) ); $category_name = str_replace( ',', '', $cat_name); Thanks
  11. I used this in the end: $cat_name = $subterms->name; $amp = array(" & "); $and = array("-and-"); $category_name = str_replace($amp, $and, strtolower($cat_name) );
  12. I am not sure where the job_listing_function is - I don't know much about PHP. This is the contents of the page I am editing: <?php /* * Helpers */ function jobseek_partition( $list, $p ) { $listlen = count( $list ); $partlen = floor( $listlen / $p ); $partrem = $listlen % $p; $partition = array(); $mark = 0; for ($px = 0; $px < $p; $px++) { $incr = ($px < $partrem) ? $partlen + 1 : $partlen; $partition[$px] = array_slice( $list, $mark, $incr ); $mark += $incr; } return $partition; } /** * Limits number of words from string */ if ( ! function_exists( 'jobseek_string_limit_words' ) ) : function jobseek_string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if (count($words) > $word_limit) { array_pop($words); //add a ... at last article when more than limit word count return implode(' ', $words) ; } else { //otherwise return implode(' ', $words); } } endif; // Shortcode prints grid of categories add_shortcode('jobs_categories', 'jobseek_jobs_categories'); function jobseek_jobs_categories( $atts ) { extract(shortcode_atts(array( 'columns' => '4', 'orderby' => 'count', 'number' => '99', 'hide_empty' => 0, 'jobs_counter' => 'no', 'type' => 'all', 'parent_id' => '', ), $atts)); $output = ''; if( $type == 'all' ) { $categories = get_terms( array( 'taxonomy' => 'job_listing_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, ) ); if ( !is_wp_error( $categories ) ) { $output .= '<div class="category-groups columns-' . $columns . '">'; $chunks = jobseek_partition($categories, $columns); foreach( $chunks as $chunk ) { $output .= '<ul>'; foreach ( $chunk as $term ) { $output .= '<li><a href="' . get_term_link( $term ) . '">' . $term->name; if( $jobs_counter == 'yes' ) { $output .= '<span>' . $term->count . '</span>'; } $output .= '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } if( $type == 'only_parents' ) { $categories = get_terms( array( 'taxonomy' => 'job_listing_category', 'parent' => 0, 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, ) ); if( !is_wp_error( $categories ) ) { $output .= '<div class="category-groups columns-' . $columns . '">'; $chunks = jobseek_partition($categories, $columns); foreach ( $chunks as $chunk ) { $output .= '<ul>'; foreach ( $chunk as $term ) { $output .= '<li><a href="' . get_term_link( $term ) . '">' . $term->name; if( $jobs_counter == 'yes' ) { $output .= '<span>' . $term->count . '</span>'; } $output .= '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } if( $type == 'group_by_parents' ) { $parents = get_terms( array( 'taxonomy' => 'job_listing_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, 'parent' => 0 )); //CATEGORY HEADERS if ( !is_wp_error( $parents ) ) { foreach( $parents as $key => $term ) : $subterms = get_terms("job_listing_category", array("orderby" => $orderby, "parent" => $term->term_id, 'hide_empty' => $hide_empty)); $output .= '<h3><a href="' . get_term_link( $term ) . '">'. $term->name .'</a></h3>'; if( $subterms ) : $chunks = jobseek_partition($subterms, $columns); foreach ($chunks as $chunk) { $output .= '<div class="category-boxes ' . strtolower($term->name) . '-category-wrapper' . '">'; foreach ($chunk as $subterms) { $category_name = str_replace(' ', '-', strtolower($subterms->name)); $output .= '<div class="category-item"><a href="' . get_term_link( $subterms ) . '" class="'. $category_name .'">' . $subterms->name; if($jobs_counter=='yes'){ $output .= '<span>' . $subterms->count . '</span>'; } $output .= '</a></div>'; } $output .= '</div>'; } endif; endforeach; } } if( $type == 'parent' ) { if ( !is_wp_error( $categories ) ) { $subterms = get_terms( array( 'taxonomy' => 'job_listing_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, 'parent' => $parent_id, )); $term = get_term( $parent_id, "job_listing_category" ); if( $subterms ) { $output .= '<div class="category-groups"><h3 class="parent-jobs-category"><a href="' . get_term_link( $term ) . '">'. $term->name .'</a></h3>'; $chunks = jobseek_partition($subterms, $columns); foreach ( $chunks as $chunk ) { $output .= '<ul>'; foreach ($chunk as $subterms) { $output .= '<li><a href="' . get_term_link( $subterms ) . '">' . $subterms->name; if($jobs_counter=='yes'){ $output .= '<span>' . $subterms->count . '</span>'; } $output .= '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } } return $output; } add_shortcode('resume_categories', 'jobseek_resumes_categories'); function jobseek_resumes_categories( $atts ) { extract(shortcode_atts(array( 'columns' => '4', 'orderby' => 'count', 'number' => '99', 'hide_empty' => 0, 'resumes_counter' => 'no', 'type' => 'all', 'parent_id' => '', ), $atts)); $output = ''; if( $type == 'all' ) { $categories = get_terms( array( 'taxonomy' => 'resume_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, ) ); if ( !is_wp_error( $categories ) ) { $output .= '<div class="category-groups columns-' . $columns . '">'; $chunks = jobseek_partition($categories, $columns); foreach ($chunks as $chunk) { $output .= '<ul>'; foreach ($chunk as $term) { $output .= '<li><a href="' . get_term_link( $term ) . '">' . $term->name . '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } if( $type == 'group_by_parents' ) { $parents = get_terms( array( 'taxonomy' => 'resume_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, 'parent' => 0 ) ); if ( !is_wp_error( $parents ) ) { foreach( $parents as $key => $term ) { $subterms = get_terms( array( 'taxonomy' => 'resume_category', 'orderby' => $orderby, 'parent' => $term->term_id, 'hide_empty' => $hide_empty ) ); if( $subterms ) { $output .= '<div class="category-groups columns-' . $columns . '"><h3 class="parent-resumes-category"><a href="' . get_term_link( $term ) . '">'. $term->name .'</a></h3>'; $chunks = jobseek_partition($subterms, $columns); foreach( $chunks as $chunk ) { $output .= '<ul>'; foreach( $chunk as $subterms ) { $output .= '<li><a href="' . get_term_link( $subterms ) . '">' . $subterms->name . '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } } } if( $type == 'parent' ) { if ( !is_wp_error( $categories ) ) { $subterms = get_terms( array( 'taxonomy' => 'resume_category', 'orderby' => $orderby, 'hide_empty' => $hide_empty, 'number' => $number, 'parent' => $parent_id, ) ); $term = get_term( $parent_id, 'resume_category' ); if( $subterms ) { $output .= '<div class="category-groups columns-' . $columns . '"><h3 class="parent-resumes-category"><a href="' . get_term_link( $term ) . '">' . $term->name . '</a></h3>'; $chunks = jobseek_partition($subterms, $columns); foreach( $chunks as $chunk ) { $output .= '<ul>'; foreach( $chunk as $subterms ) { $output .= '<li><a href="' . get_term_link( $subterms ) . '">' . $subterms->name . '</a></li>'; } $output .= '</ul>'; } $output .= '</div>'; } } } return $output; } ?> The part where I am updating is under the comment //CATEGORY HEADERS
  13. Hi, I have come up with another solution: $category_name = str_replace(' ', '-', strtolower($subterms->name)); This works, but it is keeping the "&" in the category names. for example: food-&-drink How can I replace the "&" with "and" ? Thanks
  14. Hi, It's using WordPress with WP-Job Manager plugin
  15. Ok, I have trid this which sort of does what I am wanting it to do,: $output .= '<li class="category-item"><a href="' . get_term_link( $subterms ) . '" class="' . $subterms->name . '">' . $subterms->name; I'm basically trying to give each item in a list of categories its own class so I can style it differently. The above works, but it outputs the class with spaces in: <a href="https://www.website.co.uk/phase-2/category/arts-and-crafts-competitions/" class="Arts & Crafts Competitions">Arts & Crafts Competitions<span>0</span></a> Is there a way I can remove the spaces from the class or replace the space with a hyphen? I assume I can't use classes with spaces in.
  16. Hi, Thanks for the reply. Yes, it's doing what you said, its echoing it: class=""class=""class=""class=""class=""class=""class=""class=""class=""class=""class=""class=""class="" I will see if I can work out another way.
  17. Hi, Thanks for the reply. I see what you mean. The problem I'm having is adding the actual <?=job_listing_class()?> to this line of PHP: <a href="' . get_term_link( $subterms ) . '"> $output .= '<ul>'; foreach ($chunk as $subterms) { $output .= '<li><a href="' . get_term_link( $subterms ) . '">' . $subterms->name; if($jobs_counter=='yes'){ $output .= '<span>' . $subterms->count . '</span>'; } $output .= '</a></li>'; } $output .= '</ul>';
  18. Hi, I am trying to add the following to a line of PHP to give a link a class. It works fine when I do it like this and the below automatically adds the class="" part to the HTML <section id="title" <?php job_listing_class(); ?>> But when I try the following, it doesn't work: $output .= '<li><a href="' . get_term_link( $subterms ) . '" ' . job_listing_class(); . ' >' . $subterms->name; if($jobs_counter=='yes'){ $output .= '<span>' . $subterms->count . '</span>'; } $output .= '</a> It's this part that I can't get to work: $output .= '<li><a href="' . get_term_link( $subterms ) . '" ' . job_listing_class(); . ' >' . $subterms->name; Can anyone help me with the code I have? Thanks
  19. Hi, I have the following code in a WordPress theme which displays a companies website, Twitter and Facebook links. What I am trying to do is display the text "Useful Links:" if one of the links exists, and hide the text if all are not present. <p>Useful Links:</p> <?php if ( $website = get_the_company_website() ) : ?> <a class="company-website" href="<?php echo esc_url( $website ); ?>" itemprop="url" target="_blank" rel="nofollow"><?php _e('Website', 'jobseek'); ?></a> <?php endif; ?> <?php if ( get_the_company_twitter() ) : ?> <a class="company-twitter" href="http://twitter.com/<?php echo get_the_company_twitter(); ?>" target="_blank"><?php _e('Twitter', 'jobseek'); ?></a> <?php endif; ?> <?php $facebook_link = get_post_meta( get_the_ID(), '_facebook_link', true ); if ( ! empty($facebook_link) ) : ?> <a class="company-facebook" href="<?php echo $facebook_link; ?>" target="_blank">Facebook</a> <?php endif; ?> What would be the best way to show/hide the text depending on if the items are present or not? Thanks
  20. Thank you very much I modified it to show just the days with the $expired_date variable:
  21. Hi, I have a job listing website which displays the closing date of applications using: $expired_date (This displays a date such as 31st December 2019) I am trying to show a countdown/number of days left until the closing date. I have put this together, but I can't get it to show the number of days. <?php $expired_date = get_post_meta( $post->ID, '_job_expires', true ); $hide_expiration = get_post_meta( $post->ID, '_hide_expiration', true ); if(empty($hide_expiration )) { if(!empty($expired_date)) { ?> <span><?php echo date_i18n( get_option( 'date_format' ), strtotime( get_post_meta( $post->ID, '_job_expires', true ) ) ) ?></span> <?php $datetime1 = new DateTime($expired_date); $datetime2 = date('d'); $interval = $datetime1->diff($datetime2); echo $interval->d; ?> <?php } } ?> Can anyone help me with what I have wrong? Many thanks
  22. Hi, I have a database which stores listings in 2 main categories. I am trying to select the total number of listings in each of the categories with term_taxonomy_id's of 109 and 110 that have been added within the last 3 days. This is what I have so far, but it’s not showing anything when echoing. I also don’t know how to select them based on a time period of 3 days $total_competitions = mysql_query("SELECT COUNT(term_taxonomy_id=109) FROM wp_term_taxonomy;"); echo $total_competitions; Could anyone help me with the query? This is a screenshot of the table in phpmyadmin: https://ibb.co/p34mxDd
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.