Peter
Forum Replies Created
-
Forum: Localhost Installs
In reply to: Installing on my domainSo your current site the index page is: https://www.venceremos.biz/index.shtml ??
If that is the cae and you have installed it in the root of your web server then wordpress is at https://www.venceremos.biz/index.php .
However: This won’t work for you as your server will redirect the request for index.php back to index.shtml .. You will need to either remove or rename index.shtml .. or you can add an entry in your .htaccess file like this:
RewriteCond %{THE_REQUEST} ^.*/index.shtml
RewriteRule ^(.*)index.shtml$ https://www.venceremos.biz/$1 [R=301,L]Forum: Fixing WordPress
In reply to: Remove the div and ul tags from wp_nav_menu() functionAll good stuff..
However if like myself you would like to strip both UL and LI tags and only affect one of your menus in this case my Secondry Menu located n the footer you want something like this:<?php $foot_nav = wp_nav_menu( array( 'container' => '', 'echo' => '0', 'theme_location' => 'secondary-menu' ) ); $foot_nav2 = preg_replace( array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $foot_nav ); $foot_nav2 = preg_replace( array( '#<li[^>]*>#', '#</li>$#' ), '', $foot_nav2 ); echo $foot_nav2; ?>
Just paste it where you want it to appear in your theme.
N.B:
You will need to amend the'theme_location' => 'secondary-menu'
to match the menu you are using.Enjoy!
Forum: Fixing WordPress
In reply to: Static Page with Password & ArticlesHi,
You cannot use the default wordpress setting to password protect your static page that you then set as your posts page if you follow.You need to set a custom template for your posts page.
Create a new blank plain text document call it postpage.php and save it within
/wp-content/themes/**the name of the theme your using/**Then when you create the page to show your posts in choose postpage as the template.
As raw PHP put in the following to the blank text document postpage.php
so you don’t get your themes formatting with this;<?php
/*
Template Name: postspage
*/
?>
<?php get_header(); ?>
<?php
$lastposts = get_posts();
foreach($lastposts as $post) :
setup_postdata($post);
?>
<div class=”item”>
<h2><?php the_title(); ?></h2>
<p class=”date”><?php the_time(‘j.m.Y’) ?></p>
<?php the_content(); ?>
</div>
<?php endforeach; ?>
<?php get_sidebar(); ?>
<?php include (TEMPLATEPATH . “/footer.php”); ?>To add in your themes formatting you’ll need to copy the code from index.php within your themes folder and insert the above php in the right place. This would look something like this:
<?php
/*
Template Name: postspage
*/
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”https://www.w3.org/1999/xhtml” <?php language_attributes() ?>>
<head>
<?php get_header(); ?>
</head>
<body>
<div class=”main”>
<div class=”container”>
<?php include (TEMPLATEPATH . “/head.php”); ?><div class=”content span-24″>
<div class=”posts span-17 last”>
<?php include (TEMPLATEPATH . “/banner.php”); ?><div class=”paddings”>
<?php
$lastposts = get_posts();
foreach($lastposts as $post) :
setup_postdata($post);
?>
<ul class=”items”>
<h2><?php the_title(); ?></h2>
<p class=”date”><?php the_time(‘j.m.Y’) ?></p>
<?php the_content(); ?>- <?php include (TEMPLATEPATH . “/item.php”); ?>
- <?php include (TEMPLATEPATH . “/missing.php”); ?>
-
<div class=”navigation”>
<div class=”fl”><?php next_posts_link(__(‘« Older Entries’, ‘default’)) ?></div>
<div class=”fr”><?php previous_posts_link(__(‘Newer Entries »’, ‘default’)) ?></div>
<div class=”clear”></div>
</div>
<?php endforeach; ?>
</div>
</div><?php get_sidebar(); ?>
</div>
<div class=”clear”></div><?php include (TEMPLATEPATH . “/footer.php”); ?>
</div>
</div>
</body>
</html>