matthisco
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display latest post from categoryThats great many thanks.
However, the page does not break this time, but the latest post does not display.
I am using pages not posts, does that matter?
Thanks again, really appreciate your help.
Forum: Fixing WordPress
In reply to: Display latest post from categoryThanks for your reply.
I’ve used your code, but just get a blank whit screen
Can you please help?
Here is my code:
<?php $cat_id = 7; //the certain category ID $latest_cat_post = new WP_Query( array('posts_per_page' => 1, 'category__in' => array($cat_id)); if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content(); ?> <?php endwhile; endif; ?>
Forum: Fixing WordPress
In reply to: Display latest post from categoryThanks for the reply.
I just need to display the latest post in full from a certain category of posts, the title, text etc.
Im using the 2010 theme.
Forum: Fixing WordPress
In reply to: How to redirect old aspx links?Thanks for your reply.
Whan I try and add permalinks to a page like ‘page.aspx’ it turns the dot into a dash.
Can you help?
Thanks again
Forum: Fixing WordPress
In reply to: CSS3 and Internet explorer – background imageBrilliant thanks folks
Forum: Fixing WordPress
In reply to: CSS3 and Internet explorer – background imageSorry my bad, is there a way I can get css2 to work in IE 6?
Thanks again
Forum: Fixing WordPress
In reply to: Subpages of page – Urgent syntax help needed pleaseThanks very much that works a treat
Forum: Fixing WordPress
In reply to: How to create page of news postsThanks for you reply, really appreciate it.
I have created the pageofposts.php page, uploaded it to my theme folder, created another page called news with no content and chose the pageofposts page as its template.
However nothing appears when I browse to the page, do I need to pass the category ID of posts to this page somehow?
Any help very much appreciated.
Thanks again
Forum: Fixing WordPress
In reply to: White space on homepageThankyou
Forum: Fixing WordPress
In reply to: Basic query needed using page idCracked it!!!
<?php // Include WordPress define('WP_USE_THEMES', false); //exact path for wp-load.php. // This file is kept in the root of wordpress install require('wp-load.php'); //Query wordpress for latest 4 posts query_posts('page_id=127'); ?> <?php while (have_posts ()): the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?>
<?php endwhile; ?>
Forum: Fixing WordPress
In reply to: Basic query needed using page idFirther progress, I can use this code outside of wordpress to generate posts, is there a way I can qeury a page by passing the pageid to it?
<?php // Include WordPress define('WP_USE_THEMES', false); //exact path for wp-load.php. // This file is kept in the root of wordpress install require('wp-load.php'); //Query wordpress for latest 4 posts query_posts('showposts=5'); ?> <?php while (have_posts ()): the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <?php endwhile; ?>
Thanks again
Forum: Fixing WordPress
In reply to: Basic query needed using page idMany thanks for your reply.
I’ve read through the docs a few times, but I cannot understand how to simply echo out the title and content with no other html.
The reason I’m asking is I’d like to pull my wordpress pages into a facebook canvas page, which needs to be pointed to a url, https://www.xx.com?page_id=sample
I can use the same content for my wordpress site and facebook that way, so I dont have to update two different sites.
So if I create a page on my wordpress theme hardcoded with the page id, something like this:
about.php
<?php $my_postid = 127;//This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
But it keeps generating an error saying it cant find the get function.
Any sample code/ help very much appreciated.
Forum: Fixing WordPress
In reply to: Basic query needed using page idI have created a page in the htdocs using this code:
<?php $my_postid = 127;//This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
But i get the error:
Fatal error: Call to undefined function get_post() in /home/fhlinux150/m/xxxx.co.uk/user/htdocs/about.php on line 3
Can anyone please help?
Forum: Fixing WordPress
In reply to: excerpt of posts on homepageTHis doesnt work either:
<?php $page_id = 14;//This is page id or post id $content_post = get_page($my_postid); $content = $content_post->post_content; $content = apply_filters('the_excerpt', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
All I get is:
<div class=”post-teaser-block”>Permanent link to this post (1 word, estimated 0 secs reading time)</div>
Anyone?
Forum: Fixing WordPress
In reply to: excerpt of posts on homepageSomething like this perhaps?
<?php $my_id = 7; $post_id_7 = get_post($my_id); $content = $post_id_7->post_excerpt; echo $content; ?>