Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter waterwalk

    (@waterwalk)

    p.s. I did try this:

    <label>Country[countries* address_country default:get “United States (US)”]</label>

    It seems to work in Safari but on the backend it shows an error (in the contact form side panel). I’m not sure if that is due to the change or not though since the error does not say what is wrong.

    Thread Starter waterwalk

    (@waterwalk)

    Hi, I do not see any plugins to take care of this. There is a javascript on the backend written by the original developer but it has no list of countries. I did try doing the ‘select’ with just regular Contact Form 7 syntax (i.e. default “United States”) but that did not work on Safari/iOS either. Any suggestions on what else we might try?

    Thread Starter waterwalk

    (@waterwalk)

    Sorry, I did not get notified that there was a response. The form is on this page: https://welcome.calsouthern.edu/

    If you look at it on Safari or an iOS device the dropdown preselects “Afghanistan” even though we have “United States” set as the default.

    Thread Starter waterwalk

    (@waterwalk)

    As another possibility can I put all the “J” artists in a subcategory called “J” under the main category “Artists” and then have it list just those artists in that one subcategory “J”. I tried experimenting with that but can’t get it to work. It’s not ideal as I would really prefer not to have a letter subcategory for each letter of the alphabet but I’ve spend a couple days on this plugin and a couple of others and still haven’t found a solution.

    Thread Starter waterwalk

    (@waterwalk)

    Okay, thanks. Wasn’t sure where to go on that.

    Thread Starter waterwalk

    (@waterwalk)

    Calvin, thanks so much. I’ll go check it out. Have a great rest of the week : )

    Forum: Plugins
    In reply to: Get categories for a post?
    Thread Starter waterwalk

    (@waterwalk)

    Latest code:

    function recent_posts_function($atts){
    
       extract(shortcode_atts(array(
          'posts' => 5,
       ), $atts));
    
       $return_string = '<ul>';
       query_posts(array('orderby' => 'date', 'order' => 'DESC' , 'showposts' => $posts));
       if (have_posts()) :
          while (have_posts()) : the_post();
    	  global $post;
    
    	  $categories = get_the_category($post->ID);
    $separator = ' | ';
    $output = '';
     $cat_link = get_category_link($categories[0]->cat_ID);
     if($categories){
    	foreach($categories as $category) {
    		$output .= '<a href="'.get_category_link( $category->term_id ).'" id="'.$category->slug.'">'.$category->cat_name.'</a>'.$separator;
    	}
    
     }
             $return_string .= '<li>'.$output.'
     <br/><a href="'.get_permalink().'">'.get_the_title().'</a><br/><img src="/wp-content/uploads/2015/01/post-date.jpg" border="0" style="float: left; padding-right:5px;">'.get_the_date().'<br/><br/>
    		 </li>';
          endwhile;
       endif;
       $return_string .= '</ul>';
    
       wp_reset_query();
       return $return_string;
    }
    
    function register_shortcodes(){
       add_shortcode('kapitall-recent-posts', 'recent_posts_function');
    }
    
    add_action( 'init', 'register_shortcodes');
    Forum: Plugins
    In reply to: Get categories for a post?
    Thread Starter waterwalk

    (@waterwalk)

    Okay, I have gotten this far now and am able to display one category but am still unsure how to display all categories for a post that has several categories. If I am posting in the wrong area please let me know. I thought this would be the best fit since I’m basically creating a my own plugin (shortcode) to add to the site.

    This code works now but only for 1 category. Can anyone help me figure out how to make it work so that multiple categories will show the same information (category link with its associated category slug as id, category title). Thanks in advance.

    function recent_posts_function($atts){
    
       extract(shortcode_atts(array(
          'posts' => 5,
       ), $atts));
    
       $return_string = '<ul>';
       query_posts(array('orderby' => 'date', 'order' => 'DESC' , 'showposts' => $posts));
       if (have_posts()) :
          while (have_posts()) : the_post();
    	  global $post;
    	  $categories = get_the_category($post->ID);
     $cat_link = get_category_link($categories[0]->cat_ID);
             $return_string .= '<li><a href="'.$cat_link.'" id="'.$categories[0]->slug.'">'.$categories[0]->cat_name.'</a>
     <br/><a href="'.get_permalink().'">'.get_the_title().'</a><br/><img src="/wp-content/uploads/2015/01/post-date.jpg" border="0" style="float: left; padding-right:5px;">'.get_the_date().'<br/><br/>
    		 </li>';
          endwhile;
       endif;
       $return_string .= '</ul>';
    
       wp_reset_query();
       return $return_string;
    }
    
    function register_shortcodes(){
       add_shortcode('kapitall-recent-posts', 'recent_posts_function');
    }
    
    add_action( 'init', 'register_shortcodes');
    Forum: Plugins
    In reply to: Get categories for a post?
    Thread Starter waterwalk

    (@waterwalk)

    Still hoping someone can give some direction on this. I am trying to insert categories for a post (before the post title). I’m sure I’m doing something wrong with syntax but not sure yet where the error is. Here was my most recent attempt (categories still not displaying). Any help would be appreciated.

    function recent_posts_function($atts){
    
       extract(shortcode_atts(array(
          'posts' => 5,
       ), $atts));
    
       $return_string = '<ul>';
       query_posts(array('orderby' => 'date', 'order' => 'DESC' , 'showposts' => $posts));
       if (have_posts()) :
          while (have_posts()) : the_post();
    
             $return_string .= '<li>
    		<?php
    foreach((get_the_category()) as $category) {
        echo $category->cat_name . " ";
    }
    ?>
    
    		<a href="'.get_permalink().'">'.get_the_title().'</a><br/><img src="/wp-content/uploads/2015/01/post-date.jpg" border="0" style="float: left; padding-right:5px;">'.get_the_date().'<br/><br/>
    		 </li>';
          endwhile;
       endif;
       $return_string .= '</ul>';
    
       wp_reset_query();
       return $return_string;
    }
    
    function register_shortcodes(){
       add_shortcode('kapitall-recent-posts', 'recent_posts_function');
    }
    
    add_action( 'init', 'register_shortcodes');
    Thread Starter waterwalk

    (@waterwalk)

    Hi Shazzad, I spoke to you by email and yes that works. Thank you again for your help.

    Thread Starter waterwalk

    (@waterwalk)

    Thanks for the feedback. I’m trying to debate if I want to turn the plugin back on again because this is not a site I look at very often and I’d hate to think it went down again and I didn’t know it.

    I’m not an .htaccess guru by any means. Is there some way to get a copy of the corrected version for that statement in case I decide to use the plugin again and need to edit the .htaccess file?

    Thanks.

    Thread Starter waterwalk

    (@waterwalk)

    I’m still researching. Is it possible that line of code:

    <?php header(“Location: /”); get_header(); ?>

    is sending all 404’s to the home page (“/”)? I thought it was just making a call for the header but perhaps it’s doing more?

    Thread Starter waterwalk

    (@waterwalk)

    I looked and unfortunately I’m not seeing anything in the 404.php file. The only thing that looks like is not code for the menu and content is this:

    <?php header(“Location: /”); get_header(); ?>

    The rest of the page looks pretty normal. I am stumped as to how all these 404s are being redirected to the home page without an .htaccess file or a plugin in place. Still open to ideas if anyone has any.

    Thanks.

    Thread Starter waterwalk

    (@waterwalk)

    Yep, https://www.potomac.edu/about/ is currently part of the menu, but /about-us/ is the old link which instead of getting redirected goes to the home page.

    I will check the 404 file to see if there’s anything there. Thanks for looking and for the suggestion : )

    Hi, I’m facing a stiff deadline and the redirect code does not work for me. This is such a basic request and there are many reasons to have a ‘thank you’ page. In our instance we need to provide them HTML links after submitting the form and direct them to the next step. Has anyone gotten this to work? I’m just surprised they wouldn’t have built this into the plugin. OR does anyone have another plugin they like that does the same type of thing but includes redirect functionality? Thanks.

Viewing 15 replies - 1 through 15 (of 22 total)