Wordpress Category Issue

Montgomery76

Registered Member
Joined
Apr 17, 2013
Messages
58
Reaction score
18
Hi guys,
Is there a way to replace the default category listing in Wordpress with a page? Need to add content to the Category listing...

I want the following structure

Home -> CategoryPage (page - not archive)->Post
domain.com / CategoryPageName / Postname

Please note that the CategoryPage should be an editible fully functional Page in Wordpress - not the default category listing.
I know that I could list posts from a page. But then the URL to the Article/Post will be wrong. I want the articles to be placed UNDER the page...

Any ideas?

Thx guys,
m.
 
Kindof solved it...found this code. If I create a page and a category with the exact same slug PHP get the content data from the page...


<?php
if ( is_category() ) {
// Get current category slug
$cat = get_query_var( 'cat' );
$cat_object = get_category( $cat );
$category_slug = $cat_object->slug;

// Get the ID of the static page with the same slub
$category_static_page_id = get_page_by_path( $category_slug );

// If such a page exists, get it
if ( isset( $category_static_page_id ) ) {
// Get the static page object
$category_static_page = get_page( $category_static_page_id );

// Output page content
// Apply the usual the_content filters,
// for usual "nice" formatting
echo apply_filters( 'the_content', $category_static_page->post_content );
}
}
?>
 
Back
Top