Title: Ken Lewis's Replies - page 2 | WordPress.org

---

# Ken Lewis

  [  ](https://wordpress.org/support/users/trinity13/)

 *   [Profile](https://wordpress.org/support/users/trinity13/)
 *   [Topics Started](https://wordpress.org/support/users/trinity13/topics/)
 *   [Replies Created](https://wordpress.org/support/users/trinity13/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/trinity13/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/trinity13/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/trinity13/engagements/)
 *   [Favorites](https://wordpress.org/support/users/trinity13/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/users/trinity13/replies/?output_format=md) [1](https://wordpress.org/support/users/trinity13/replies/?output_format=md)
2

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [My site's been hacked, help please.](https://wordpress.org/support/topic/my-sites-been-hacked-help-please/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/my-sites-been-hacked-help-please/#post-3604501)
 * If you can add a plugin, add [https://www.wordfence.com/](https://www.wordfence.com/)
   and set your options “Scans to include” to all of the free ones.
 * Run a scan. The results should allow you to restore files to the original files.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Function Reference/wp enqueue script](https://wordpress.org/support/topic/function-referencewp-enqueue-script/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/function-referencewp-enqueue-script/#post-3604492)
 * In your theme you should tell WP that you need jQuery by using the following 
   code (don’t add the <script> tag in your header):
 *     ```
       <?php
       function my_scripts_method() {
           wp_enqueue_script( 'jquery' );
       }
   
       add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
       ?>
       ```
   
 * For the script that is to use jQuery do the following:
 *     ```
       <script language="javascript" type="text/javascript">
       jQuery(document).ready(function($) {
   
       });
       </script>
       ```
   
 * In WordPress you have to call jQuery by name. The (4) allows you to use the $
   shortcut within the confines of this call.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Shortcode or Template tag](https://wordpress.org/support/topic/shortcode-or-template-tag/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/shortcode-or-template-tag/#post-3604489)
 * Shortcodes go into the post or page in the editor.
 * The “template tag” goes into the template file inside php tags
    <?php mab_get_actionbox(
   ACTIONBOX ID); ?>
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Don't know the lingo – Subdomain address redirecting to nonexistent theme.](https://wordpress.org/support/topic/dont-know-the-lingo-subdomain-address-redirecting-to-nonexistent-theme/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/dont-know-the-lingo-subdomain-address-redirecting-to-nonexistent-theme/#post-3604486)
 * Well, now that we know where the correct files are located, the real question
   is why is it showing up as 2 different sites?
 * I think the mistake was made in the hosting control panel.
 * >  I’ve registered the subdomain with hostgator etc, and I must sign in separately
   > to access the subdomain which is “aboutme.propprintables.com”
 * Typically you wouldn’t have to sign-in to access a subdomain if you have set 
   it up in cPanel under the main domain. It appears as you have setup the subdomain
   as a separate account AND have it setup under the main domain.
 * If this is the case, then you need to upload that theme to the separate subdomain
   account since it is currently residing in the main domain account.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Don't know the lingo – Subdomain address redirecting to nonexistent theme.](https://wordpress.org/support/topic/dont-know-the-lingo-subdomain-address-redirecting-to-nonexistent-theme/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/dont-know-the-lingo-subdomain-address-redirecting-to-nonexistent-theme/#post-3604481)
 * If you go to [http://propprintables.com/aboutme/](http://propprintables.com/aboutme/)
   does that show the theme you are developing?
 * Some hosting accounts put the subdomain files in a folder within the main website
   file system and is then visible by using a link like I provided above.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Image path problem when changing URL](https://wordpress.org/support/topic/image-path-problem-when-changing-url/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/image-path-problem-when-changing-url/#post-3604074)
 * Not much you can do about it. Unfortunately the full URL is put in the DB instead
   of just using relative path.
 * What I personally do:
    1. Backup DB to a .sql file
    2. Use Notepad++ to do a replace of the Development URL with the Production URL
    3. Restore the DB to the Production Server
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Widgetized footer 3 Colums](https://wordpress.org/support/topic/widgetized-footer-3-colums/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/widgetized-footer-3-colums/#post-3601092)
 * You want to use sidebars.
 * Register sidebar: [http://codex.wordpress.org/Function_Reference/register_sidebar](http://codex.wordpress.org/Function_Reference/register_sidebar)
 * Show sidebar: [http://codex.wordpress.org/Function_Reference/get_sidebar](http://codex.wordpress.org/Function_Reference/get_sidebar)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/4/#post-2542198)
 * Actually, that’s the exact same result. I just set the information in my array
   separately from the get_pages request.
 *     ```
       get_pages(array())
       ```
   
 * and
 *     ```
       $arr = array();
       get_pages($arr);
       ```
   
 * are equivelent.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/4/#post-2542195)
 * I’m glad you got it figured out.
 * I would like to point out that I kept saying that hierarchical had to be set 
   to 0 ever since my 2nd post a week ago.
 * For future issues, you really should try the code that is offered.
 * Happy coding!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/3/#post-2542192)
 * The strange part of all of this is that I use the EXACT code below and it works
   like a champ:
 *     ```
       <?php
           $location_pages_args = array(
               'meta_key' => '_wp_page_template',
               'meta_value' => 'locations-page.php',
               'depth' => -1,
               'hierarchical' => 0
           );
   
           $location_pages = get_pages( $location_pages_args );
   
           foreach ( $location_pages as $location_page ) {
               $selected = ($location_page->ID == $cw_location)?"selected='selected'":"";
               echo '<option value="' . $location_page->ID . '" '.$selected.'>' . $location_page->post_title  . '</option>';
           }
       ?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/3/#post-2542190)
 * Try the exact code I showed above
 *     ```
       <?php  $product_pages_args = array(
       	'meta_key' => '_wp_page_template',
       	'meta_value' => 'products.php',
       	'depth' => -1,
       	'hierarchical' => 0,
       	'child_of' => 0
       );
       $product_pages = get_pages($product_pages_args );
       ```
   
 * and then put this in the viewing area
 *     ```
       <pre>
       <?php print_r($product_pages); ?>
       </pre>
       ```
   
 * hierarchical and child_of must be 0
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/3/#post-2542180)
 * I think it’d be worth it to try this though I am not sure how well it’d work 
   since the extra code should be the default according to the code in post.php.
 * Change the code to this:
 *     ```
       <?php
           $product_pages_args = array(
               'meta_key' => '_wp_page_template',
               'meta_value' => 'products.php',
               'depth' => -1,
               'hierarchical' => 0,
               'child_of' => 0
           );
   
           $product_pages = get_pages( $product_pages_args );
       ?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/3/#post-2542178)
 * After looking through how WordPress handles the requests, I have more information
   about this.
 * First of all, Chip’s code is very close to providing the list using [get_pages](http://codex.wordpress.org/Function_Reference/get_pages).
   To use the code he provided, change the $product_pages_args to this:
 *     ```
       <?php
           $product_pages_args = array(
               'meta_key' => '_wp_page_template',
               'meta_value' => 'products.php',
               'depth' => -1,
               'hierarchical' => 0
           );
   
           $product_pages = get_pages( $product_pages_args );
       ?>
       ```
   
 * and then use his display code:
 *     ```
       <ul>
           <?php
           foreach ( $product_pages as $product_page ) {
               echo '<li><a href="' . get_permalink( $product_page->ID ) . '">' . $product_page->post_title  . '</a></li>';
           }
           ?>
       </ul>
       ```
   
 * My last post where I said to use ‘wp_list_pages’ would show a list on it’s own
   and wouldn’t need the output code. So if that is what you are trying to do then
   use this:
 *     ```
       $product_pages_args = array(
               'meta_key' => '_wp_page_template',
               'meta_value' => 'product.php'
           );
   
       wp_list_pages( $product_pages_args );
       ```
   
 * All of this code was tested on WordPress 3.3.1.
 * I hope this helps.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Listing Links to All Pages Using A Particular Template](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/)
 *  [Ken Lewis](https://wordpress.org/support/users/trinity13/)
 * (@trinity13)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/listing-links-to-all-pages-using-a-particular-template-1/page/3/#post-2542177)
 * Try this modification to the code:
 * Gets the pages:
 *     ```
       $product_pages_args = array(
               'meta_key' => '_wp_page_template',
               'meta_value' => 'product.php'
           );
   
           $product_pages = wp_list_pages( $product_pages_args );
       ```
   
 * Displays the list:
 *     ```
       <ul>
                       <?php
                       foreach ( $product_pages as $product_page ) {
                           echo '<li><a href="' . get_permalink( $product_page->ID ) . '">' . $product_page->post_title  . '</a></li>';
                       }
                       ?>
                   </ul>
       ```
   

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/users/trinity13/replies/?output_format=md) [1](https://wordpress.org/support/users/trinity13/replies/?output_format=md)
2