Changing styles in Zend Framework 2 pagination - css

I am trying to replace the default style in Zend Framework 2's pagination to use Twitter Boostrap's pagination style. I am having trouble though with changing the style, as some of the elements are off and I don't know why. Here is my code:
<nav>
<ul class="pagination">
<?php if ($this->pageCount): ?>
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<li class="previous"><a href="<?php echo $this->url($this->route, array('page' => $this->previous)); ?>">
<span aria-hidden="true">«</span></a></li>
<?php else: ?>
<li class="previous disabled">«</span>
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<li class="active"><a href="<?php echo $this->url($this->route, array('page' => $page)); ?>">
<?php echo $page; ?>
</a></li>
<?php else: ?>
<?php echo $page; ?>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<li class="next"><a href="<?php echo $this->url($this->route, array('page' => $this->next)); ?>">
<span aria-hidden="true">»</span></a></li>
<?php else: ?>
<li class="next disabled">»</li
<?php endif; ?>
<?php endif; ?>
</ul>
</nav>
If it helps, here is a screenshot of what I am trying to say.
As you can see, the elements are off. Any help would be appreciated.
Thanks!

nevermind fixed it, was not using the right attributes.

Related

Show controls if there is more than one related thumbnail

Here is my code currently. I would like to only show the next and previous controls when there is more than one related post thumbnail. I have tried a few things but nothing gets me to where I want to be. Please help:
$recent_posts_query = new WP_Query($args);
if($recent_posts_query->have_posts()):
echo '<div class="recipes-slider-widget cs">
<h2 class="w-bot-border">';
echo $title;
echo '</h2>
<ul class="cycle-slideshow" data-cycle-fx=scrollHorz data-cycle-timeout=0 data-cycle-slides="li" data-cycle-next=".n'.$widget_idc.'" data-cycle-prev=".p'.$widget_idc.'">';
while($recent_posts_query->have_posts()):
$recent_posts_query->the_post();
?>
<?php
if(has_post_thumbnail())
{
?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('recipe-slider-widget'); ?>
</a>
<p class="info-box"><?php the_title() ?></p>
</li>
<?php
}
?>
<?php
endwhile;
echo ' </ul>
<span class="prev p'.$widget_idc.'"></span>
<span class="next n'.$widget_idc.'"></span>
</div>';
echo $after_widget;
endif;
}

How to link image in the article to image itself by default in WordPress

Is there anyway i can set the image link by default to the post itself?
I don't want to set the image link in the media up loader every time.
My code that gets content for post is this:
<?php if (!$is_paged && $archives == "false") { ?>
<?php woo_image('class=thumbnail&width='.get_option('woo_home_thumb_width').'&height='.get_option('woo_home_thumb_height')); ?>
<div class="post-title">
<h3><?php the_title(); ?></h3>
<p class="post-details"><?php _e('Posted on',woothemes); ?> <?php the_time('d. M, Y'); ?> <?php _e('by',woothemes); ?> <?php the_author_posts_link(); ?>.</p>
</div>
<?php } else { ?>
<?php woo_image('class=alignleft thumbnail&width='.get_option('woo_thumb_width').'&height='.get_option('woo_thumb_height')); ?>
<h2><?php the_title(); ?></h2>
<p class="post-details"><?php _e('Posted on',woothemes); ?> <?php the_time('d. M, Y'); ?> <?php _e('by',woothemes); ?> <?php the_author_posts_link(); ?>.</p>
<!-- <div class="comment-cloud">
<?php comments_number('0','1','%'); ?>
</div> -->
<?php } ?> <?php global $more; $more = 0;?>
<?php if ( get_option('woo_content') == "true" ) { the_content('Read More >>'); } else { the_excerpt();?><?php } ?>
</div>
<!-- Normal Post Ends -->
What i do is post an image with some lines below it and the insert a read more tag.
Is there a way i can use first image in the post and link to the article, just as the title does?
At top of the page
<?php
global $post;
global $wpdb;
?>
<a href="<?php echo get_permalink($post->ID); ?>" >
<img src="your_source_here" title="image" />
</a>
get_parmalink(); will take you to the detail page of the post respectively.

How to get Isotope Wordpress plugin mintthemes work?

I have installed the WordPress plugin Isotope from Mintthemes. But I don't get it to work. I have set the following snippet of code in my page.php and also filled in the optional settings for usage of custom post types.
<?php moveplugins_isotopes(); ?>
Added categories to my custom post type portfolio items but it doesn't work.
My code:
<?php moveplugins_isotopes(); ?>
<ul class="entrybox">
<?php
$args = array('post_type' => 'portfolio');
$loop = new WP_Query($args);
?>
<?php if ($loop->have_posts()) : while ($loop->have_posts()) : $loop->the_post(); ?>
<li class="grid_4 portfolio-post">
<a href="<?php the_permalink(); ?>">
<div class="thumbnail">
<img src="<?php print IMAGES; ?>/portfolio/thumbnails/thumbnail.png" alt="Thumbnail">
</div><!-- End .thumbnail -->
</a>
<div class="description">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
</div><!-- End div.description -->
</li><!-- End li.grid_4 projectbox -->
<?php endwhile; ?>
<?php endif; ?>
</ul><!-- End ul.entrybox -->
The problem is that your li isn't using the post_class function in WordPress. It uses that post_class to identify which items are in the loop.
It should be something like
<li class="<?php post_class( array('grid_4', 'portfolio-post') ) ?>">
You can find out more about it here:
http://codex.wordpress.org/Function_Reference/post_class

Facebook like button reacts on all posts

I think something's wrong with my query I'm using below. I want to show multiple thumbnails with each its own like button. All works fine, but when you press 1 button, it will like all other images as well. Tried the reset query, but I guess it's not working or I got things wrong. Someone got a simular problem or knows how to fix this?
<?php query_posts('cat=1'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $thumb = get_post_meta($post->ID, 'thumb', $single = true); ?>
<ul>
<li>
<img src="<?php echo $thumb; ?>" alt="View <?php the_title_attribute(); ?>'s showcase" width="150" height="111" />
<div class="design"><?php the_title(); ?></div>
<div class="subtitle">view feature</div>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
</div>
<!-- AddThis Button END -->
</li>
</ul>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php wp_reset_query() ?>
Add a fbml href attribute to the like button.
<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:href="<?php the_permalink(); ?>"></a>

more flexible or advanced page creation in wordpress 3.2.1

I've been looking into ways to make the wordpress page creation be a little more flexible.
I've gotten as far as defining my own template pages and using those to create the new pages, but I'd like to be able to have a way to input content for more than just the one post div.
When creating a page it is similar to creating a post - i.e you get to edit a title and a bit of content but that's it.
Does anyone know of a method or plugin that would allow editing the title and content of 2 divs on the same page during page creation?
I suggest you use Magic Fields. It basically allows you to add a lot of custom fields. It allows you to build advanced templates. Example of one I created recently:
<?php get_header();?> <div id="left_sidebar" class="grid_3">
<ul class="post_menu sf-menu sf-vertical">
<li class="active"><?php echo $post->post_title; ?></li>
<?php $currentPost = $post; ?>
<!-- Start Loop -->
<?php $args=array(
'post_type' => "post",
'category__in' => get_page_cats($post->ID),
'showposts' => '5000',
'order_by' => 'date',
'order' => 'ASC');
?>
<?php $menu_posts = array(); ?>
<?php $the_query = new WP_Query( $args );?>
<?php if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post(); ?>
<?php if($related_content = get('menu_parent_page')): ?>
<?php $menu_posts[$related_content]['sub'][] = array('id' => $post->ID, 'title' => $post->post_title); ?>
<?php else: ?>
<?php $menu_posts[$post->ID]['parent'] = array('id' => $post->ID, 'title' => $post->post_title); ?>
<?php endif; ?>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php $postCount = 1; ?>
<?php $totalPosts = sizeof($menu_posts); ?>
<?php if($totalPosts > 0):?>
<?php foreach($menu_posts as $the_post): ?>
<li <?php if($postCount == $totalPosts): ?> class="last<?php if($currentPost->ID == $the_post['parent']['id']): ?> active<?php endif; ?>"<?php elseif($currentPost->ID == $the_post['parent']['id']): ?> class="active"<?php endif; ?> ><?php echo $the_post['parent']['title']; ?>
<?php $totalSubPosts = sizeof($the_post['sub']); ?>
<?php $subPostCount = 1; ?>
<?php if($totalSubPosts > 0):?>
<ul>
<?php foreach($the_post['sub'] as $sub_post): ?>
<li <?php if($subPostCount == $totalSubPosts): ?> class="last" <?php endif; ?>><?php echo $sub_post['title']; ?>
<?php $subPostCount++; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php $postCount++; ?>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<div id="page_content" class="grid_9">
<!-- Start Loop -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1 class="page_header"><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php $logo_image = get_image('extra_logo_image', 1, 1, 0); ?>
<?php if($logo_image): ?>
<img class="brand_logo_all" src="<?php echo $logo_image; ?>" alt="logo" />
<?php endif; ?>
<?php endwhile; else: ?>
<p>An Error Occurred</p>
<?php endif; ?>
<?php wp_reset_query(); ?>
<!-- End Loop -->
<?php $download_items = get_group('download'); ?>
<?php if($download_items): foreach ($download_items as $item): ?>
<div class="download">
<a href="<?php echo $item['download_pdf'][1];?>">
<div class="pdf">
<table>
<tr>
<td><?php echo $item['download_description'][1];?></td>
</tr>
</table>
</div>
</a>
</div>
<?php endforeach; endif;?>
<?php $disable_call_to_action = get('extra_disable_call_to_action'); ?>
<?php if(!$disable_call_to_action): ?>
<?php include_once(TEMPLATEPATH . "/call_to_action.php"); ?>
<?php endif; ?>
</div><!-- #page_content -->
</div><!-- #container --><?php get_footer();?>

Resources