Footer not shown, when child page listing - wordpress

I created a custom page template and put these "child page listing with thumbnail" code
footer not showing when I use this code.
<!------------------section-container------------------>
<div id="section-container">
<?php
$pages = get_pages('child_of='.$post->ID.'&parent='.$post->ID.'&sort_column
=menu_order&sort_order=asc');
foreach($pages as $page)
{ ?>
<div class="section-page">
<div class="section-thumb"><a href="<?php echo get_page_link($page->ID) ?>" title="
<?php echo $page->post_title ?>">
<?php echo get_the_post_thumbnail($page->ID, array(150,100)); ?></a>
</div>
</div><!--section-text-->
</div><!--section-page-->
<?php } ?>
</div>
<!------------------section-container------------------>
Example : http://www.behance.in/our-work/

Have you also included <?php get_footer(); ?> on your custom template?
Maybe you pasted over it when you included your custom code?
Wordpress templates need to explicitly call get_header, get_sidebar and get_footer if you want to include header.php, sidebar.php and footer.php.

Related

How to separate view custom link/url from view content

I override block using these technic https://www.drupal.org/node/1089656.
<div id="<?php print $block_html_id; ?>" class="footer-links-regions <?php print $classes; ?> clearfix"<?php print $attributes; ?>>
<div class="g4_20 tgfull">
<?php print render($title_prefix); ?>
<?php if ($block->subject): ?>
<h3<?php print $title_attributes; ?>><?php print $block->subject ?></h3>
<?php endif;?>
<?php print render($title_suffix); ?>
</div>
<!-- CONTENT -->
<div class="g16_20 tgfull mhidden" <?php print $content_attributes; ?> >
<?php print $content ?>
</div>
</div>
Then I added custom link via admin and Custom URL (Link display). I realized that I can see this link inside content (I mean that this link is added to $content). I would like to handle this link and real content separately.

Custom templates, custom post type, and single page problems

I have set up a custom post type for a few sub sections of the website I am currently working on in wordpress. I need the custom post types to feed onto a template (which I have working) but I have a few questions and non working things. The read more link is not working, as in not showing up at all even? Also when I click the title links n the posts to go to the full post, they go to the correct url but there is no content in the body. I'm thinking I need to add more in the custom template.
Here is the template code :
<?php
/* Template Name:News */
?>
<?php get_header(); ?>
<div class="decade1">
<ul id="news_list">
<?php global $post; query_posts( 'post_type=news&orderby=ID&order=desc' ); while (have_posts()) : the_post(); ?>
<li>
<div class="fea_del">
<h2><?php the_title(); ?></h2>
<p><?php the_field('post_content',$post->ID); ?></p>
<a <?php $p=get_permalink( $post->ID ); ?> href="<?php echo $p; ?>" class="entire_job">Read More</a>
</div>
</li>
<?php endwhile; wp_reset_query(); ?>
</ul>
</div>
<?php get_footer(); ?>
The most important issue is the posts not showing up on their individual pages. Thanks!!

Wordpress Use Theme for Blog Only

I wish to use the Pinbin theme for my Wordpress blog only. I have created a custom theme for everything else, but for the blog, I would like to use this theme.
I took the main index php file from this template, along with the header and footer files. I renamed the header and footer files, and changed the header/footer calls to these files rather than the ones used by the rest of the site.
I assigned the theme to a page, but it's not showing any posts. The code is as follows:
<?php if (have_posts()) : ?>
<div id="post-area">
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) { ?>
<div class="pinbin-image"><?php the_post_thumbnail( 'summary-image' ); ?></div>
<div class="pinbin-category"><p><?php the_category(', ') ?></p></div>
<?php } ?>
<div class="pinbin-copy"><h2><a class="front-link" href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p class="pinbin-date"><?php the_time(get_option('date_format')); ?> </p>
<?php the_excerpt(); ?>
<p class="pinbin-link">→</p>
</div>
</div>
<?php endwhile; ?>
Any ideas on why I'm not seeing anything?
Thanks, S
The index.php file is used as a backup if there's no other template defined, you'll have to edit a different file if you want to edit a certain page type. See template hierarchy in the WordPress codex.
+
You forgot an endif; at the bottom of your file.

Wordpress NextGen Custom Template

I have a Image Gallery in NextGen and i want to show it on a page but problem is whenever i am loading image gallery with custom template it isn't loading here how is what i did, first i have a page homepage.php and at some place i added this code to show the gallery:
<?php
$NextG = new NextGEN_Shortcodes;
echo $NextG->show_gallery( array("id"=>1,"images"=>5,"template"=>"myshow") );
?>
my template file myshow.php contains this :
<ul id="slideshow">
<!-- Thumbnails -->
<?php foreach ( $images as $image ) : ?>
<li>
<?php if ( !$image->hidden ) { ?>
<img src="<?php echo $image->imageURL ?>" alt="<?php echo $image->alttext ?>" />
<?php } ?>
</li>
<?php endforeach; ?>
</ul>
Now Template file named myshow.php is located in wordpress\wp-content\themes\nggallery
and when i run the page it returns the images but it used default template what is wrong am i putting the wrong name??? am i putting the Template in wrong directory?? or is there something else ?
Ok i got the answer i only have to put right name prefix for my file "gallery-<mytemplatename>" so in above case it will be gallery-myshow.php

Menu in WordPress

When I installed WordPress I had a home menu. While editing, I added a menu item to the menu but my home menu item disappeared.
I don't know what's going on. How do I add the home menu item which links to homepage back?
I'm not sure why your home item would have disappeared after adding another item, but make sure your theme is using wp_page_menu():
http://codex.wordpress.org/Template_Tags/wp_page_menu
This carries the benefit of listing your "Home" along with your other pages.
Edit the line in the header.php
wp_page_menu( 'show_home=1');
reference in the codex : http://codex.wordpress.org/Function_Reference/wp_page_menu
If you have already added Home as menu, then copy the content of index.php into your Home.php (create this empty file in your theme) file.
Then run and check the home page.
Step 1. For linking your home page, create index.php as template file for home like the code below:
Use these codes if you're using custom theme(theme created by yourself in themes folder of wp-content other than twentyelevan, twentyten and so on.
<?php
/**
* Template Name: home
*
* Selectable from a dropdown menu on the edit page screen.
*/
?>
<?php get_header(); ?>
// whatever body code u need,u can include it here.
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post-header">
<!-- <div class="date"><?php the_time( 'M j y' ); ?></div>-->
<!-- <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent
Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>-->
<!-- <div class="author"><?php the_author(); ?></div>-->
</div><!--end post header-->
<div class="entry clear">
<?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
<?php the_content(); ?>
<!-- <?php edit_post_link(); ?>-->
<?php wp_link_pages(); ?>
</div><!--end entry-->
<div class="post-footer">
<!-- <div class="comments"><?php comments_popup_link( 'Leave a Comment', '1
Comment', '% Comments' ); ?></div>-->
</div><!--end post footer-->
</div><!--end post-->
<?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
<div class="navigation index">
<div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div>
<div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div>
</div><!--end navigation-->
<?php else : ?>
<?php endif; ?>
<div id="slider">
<?php
$tmp = $wp_query;
$wp_query = new WP_Query('posts_per_page=5&category_name=featured');
if(have_posts()) :
while(have_posts()) :
the_post();
?>
<a href="<?php the_permalink(); ?>"><?php
the_post_thumbnail('nivothumb'); ?></a>
<?php
endwhile;
endif;
$wp_query = $tmp;
?>
</div><!-- close #slider -->
<?php get_footer(); ?>
Or, if you're using wordpress builtin themes, then use these codes:
<?php
/**
* Template Name: onebyone
*
* Selectable from a dropdown menu on the edit page screen.
*/
?>
<html>
// whatever body code u need,u can include it here.
</html>
Step 2. Then open the home page in wordpress, Pages -> All pages, click edit.
Step 3. In edit page of home, in the right side you will see Dropdown named Template. Click the
dropdown, there you will see your template name as home select it and then click update
button.
Step 4. Then,On top left side corner,click your website or blog name and visit the website or
blog to check your home page by clicking on it.
Do you have a link to your site?
It may be as simple as checking a box. OR, you can create a custom menu.

Resources