These pages are mostly for my own reference but i figured somebody might have some use for them.
Panorama:
Reference: http://wpfaq.org/site/zoomify/
<script type="text/javascript" src="/Zoomify5/ZoomifyImageViewer.js"></script></pre> <style type="text/css"><!-- #Panorama01 { width: 650px; height: 500px } --></style> <pre> <script type="text/javascript">// <![CDATA[ Z.showImage("Panorama01", "/Zoomify5/images/Panorama01", "zSkinPath=/Zoomify5/Assets/Skins/Default", "zLogoVisible=0"); // ]]></script></pre> <div id="Panorama01"></div> <pre>
Latex:
I wanted a standard size of the latex equations and therefored edited: automattic-latex-dvipng.php, changing line 259 such that it only had one resolution.
$dvipng_exec = AUTOMATTIC_LATEX_DVIPNG_PATH . ' ' . escapeshellarg( $dvi_file ) . ' -o ' . escapeshellarg( $png_file ) . ' -bg ' . ( $this->bg_rgb ? escapeshellarg( "rgb $this->bg_rgb" ) : 'Transparent' ) . ' -fg ' . ( $this->fg_rgb ? escapeshellarg( "rgb $this->fg_rgb" ) : "'rgb 0 0 0'" ) . ' -T tight' . ' -D 300'; #. ' -D ' . (int) $output_resolution; exec( "$dvipng_exec > /dev/null 2>&1", $dvipng_out, $d );
Theme:
Menu width was a bit too small so i wanted the sub menus wider. First i made a child theme , and then i added the follwing line to the style.css:
.navigation-main ul ul ul a { width: 400px; }
This only happens on the third level menu.
Auto add featured image if possible:
Ref:http://wpforce.com/automatically-set-the-featured-image-in-wordpress/
Paste the following into functions.php in the child theme. (Remove if they are already there
<!--?php function wpforce_featured() { global $post; $already_has_thumb = has_post_thumbnail($post--->ID); if (!$already_has_thumb) { $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); if ($attached_image) { foreach ($attached_image as $attachment_id => $attachment) { set_post_thumbnail($post->ID, $attachment_id); } } } } //end function add_action('the_post', 'wpforce_featured'); add_action('save_post', 'wpforce_featured'); add_action('draft_to_publish', 'wpforce_featured'); add_action('new_to_publish', 'wpforce_featured'); add_action('pending_to_publish', 'wpforce_featured'); add_action('future_to_publish', 'wpforce_featured'); ?>
Adding a search box on the menu bar:
#searchsubmit { display: none; } #search { float: right; margin-top: -98px; margin-right: 22px; } #search_menu { float: right; margin-right: 22px; margin-top: 5px; }
and i had to add this to header.php line 41
<?php do_action( 'expound_navigation_after' ); ?> <div id="search_menu" > <?php get_search_form(); ?> </div> </nav><!-- #site-navigation -->
I also wanted a slider on the main page:
.flex-container { margin: 0 auto !important; } .soliloquy-container{ margin: 0 auto !important; }
and to index.php to line 18
<div id="soliloquy_slide_front"> <?php if ( function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '262' ); ?> </div>
and at the end to remove the sidebar on the frontpage:
<?php if ( ! is_home() ) : ?> <?php get_sidebar(); ?> <?php endif; ?>
To sort by last modified date:
function order_posts_by_mod_date($orderby) { if (is_home() || is_archive() || is_feed()) { $orderby = "post_modified_gmt DESC"; } return $orderby; } add_filter('posts_orderby', 'order_posts_by_mod_date', 999);