tjobbe
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude posts from certain category on blog onlyPERFECT!
Thank you Keesiemeijer!
Forum: Fixing WordPress
In reply to: Exclude posts from certain category on blog onlyI have to admit I haven’t a clue what’s going on, thanks for your patience!
I’m now getting a “No posts to display” message, here is my current code:
<?php get_header(); ?> <article class="main"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'cat' => -9, 'category__in' => array(15), 'paged' => $paged ); query_posts($args); ?> <?php if ( have_posts() ): ?> <?php get_sidebar(); ?> <div class="blogIndex"> <h2>Latest Posts</h2> <?php while ( have_posts() ) : the_post(); ?> <article> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> <h2><a href="<?php esc_url( the_permalink() ); ?>" title="Click to view: <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?><?php //the_time(); ?></time> <?php the_excerpt(); ?> <p class="button"><a href="<?php the_permalink(); ?>">read full post</a></p> </article> <?php /* $i++; if ($i % 3) { // odd number } else { echo '<hr>'; } */ endwhile; ?> </div> <?php else: ?> <h2>No posts to display</h2> <?php endif; ?> </article> <?php get_footer(); ?>
cat id 15 is the category the user would click to show the post on the blog page.
Forum: Fixing WordPress
In reply to: Exclude posts from certain category on blog onlyThat almost worked ;o)
Your code successfully excludes that category from my blog page, thanks. But what I’d like to do is have the option of showing certain products from that category on the blog page, IF they have also been assigned to another category which would hopefully override this exclusion.
This way by default all products in cat id 9 are not shown on the blog, but if the user chooses to show the odd product on the blog page, they can also assign it to another category, for example “show on blog page”.
Does that make any sense?
Forum: Fixing WordPress
In reply to: Problems inserting imagesWill give this a go and report back, thanks for your advice!
Forum: Fixing WordPress
In reply to: Problems inserting imagesSorry, it’s just my standard 404 page. No information of use on that page.
I’ve narrowed it down to just being images from my media library, rather than fresh uploads. very strange.
Forum: Fixing WordPress
In reply to: Problems with prev/next links on custom pageThat worked a treat, thanks!
here’s what I ended up with:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=29&showposts=12&posts_per_page=9&paged=' . $paged);
Forum: Fixing WordPress
In reply to: Problems with prev/next links on custom pageIt’s a custom template, with a custom loop that echos posts from a specific category.
I have 9 posts showing up as thumbnail, link and title. But I have well over 100 posts. My problem is that the prev/next buttons are showing, but they do not do anything when clicked except reload the same content with a different url (/page/2/)
Forum: Fixing WordPress
In reply to: Blank posts pageThank you so much for all your help.
I have done what you said, and it works!
Forum: Fixing WordPress
In reply to: Blank posts pageThis is my news-page.php now:
<?php /** * Template Name: News page */ get_header(); ?> <div class="all post bottomBorder"> <div class="fullWidth"> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div class="post"> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> <?php the_excerpt(); ?> </div> <?php endwhile; ?> </div></div> <?php get_footer(); ?>
I have set the news page in wordpress to be the page that displays the news, and then i have set the above page as that pages template.
Forum: Fixing WordPress
In reply to: Blank posts pageHmm, still nothing..
Forum: Fixing WordPress
In reply to: Blank posts pageAnd now I’m getting no posts displaying, I have created an index.php file. The header and footer are comign through fine, but at the point where my title and excerpt should show up – there’s nothing, yet there are two posts in the db, and ive set this same page to be the one displaying the posts?
I might just be a bit rusty, and I’m missing something obvious?
This is my news-page.php, which is the template for my news page, which is set in “reading”:
<?php /** * Template Name: News page */ get_header(); ?> <div class="all post bottomBorder"> <div class="fullWidth"> <?php query_posts(); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <div class="post"> <a class="alignright" href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail($id, 'thumbnail'); ?></a> <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> <?php the_excerpt(); ?> </div> <?php endwhile; ?> </div></div> <?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Blank posts pageYep, that’s the index.php file from my theme folder!
Right, I have now fixed that file, thanks for pointing out it was the wrong index file. That error message has now gone and I have a page!
Forum: Fixing WordPress
In reply to: Blank posts pageYes it does, but there’s nothing obviously wrong with it to my eyes:
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Fixing WordPress
In reply to: Blank posts pageGetting somewhere, I now have an error message after doing the following in wp-config.php:
define('WP_DEBUG', true);
This is what I get: Notice: Constant WP_USE_THEMES already defined in /home/masterep/public_html/wp-dev/wp-content/themes/xxx/index.php on line 14
Any pointers on this, here’s my index.php file from my theme folder:
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require('./wp-blog-header.php'); ?>
Forum: Installing WordPress
In reply to: Moving serverThanks Esmi, but I don’t think that page answers my question?
I’ve read it of course, not too thoroughly but I want to keep my domain name the same, but move from server a to server b.
I have the database and site files.
Do I just copy the site files over, and somehow import the mysql database into phpmyadmin, before I switch the nameservers over?