Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I dont know how to call it, but can I switch off auto linking in Wordpress?

I am creating my 3. theme for client, but I have not manage this problem.

For example, if I create a page or post, Wordpress automatically create a permalink on my site, www.mysite.com/posttitle. But if I wanna use this post to display it into the home page, for example it have only few lines, like copyrights or whatever.

So I create new page/post and display it into my theme by query_posts. And all is fantastic, until I type www.mysite/copyright and there I can see only my copyrights.

How do you manage this kind of problem? Of course I can hard code it into my template, but it isnt a solution form me.

I hope you get my thought.

UPDATE. Ok I found better example :

If I wanna create portfolio page where will be all my work. So I create new template file, than new page, new category and add new posts to that category.

So I have that page mysite.com/portfolio and there is all those posts ( works ). Just title, picture and some small description.

But wordpress is automatically creating those links mysite.com/portfolio/work1, but I dont wanna it.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You don't have to create a post to hold your data, you can use the Settings API

for example you put in your functions.php:

$copyright = get_option('my_them_copyright');
if (!isset($copyright)){
    $copyright =  'Design by: <a href="domain.com">ME</a>';
    update_option('my_them_copyright',$copyright);
}

and then whenever you want to call it you use get_option() like this:

$copyright = get_option('my_them_copyright');
echo $copyright;

Update

like i commented any post/page will get a permalink automatically but what you can do is register your own post type

<?php
add_action('init', 'register_generic_data');
function register_generic_data()   
{
  $labels = array(
    'name' => _x('Generic Data', 'post type general name'),
    'singular_name' => _x('Generic Data', 'post type singular name'),
    'add_new' => _x('Add New', 'Generic Data'),
    'add_new_item' => __('Add New Generic Data'),
    'edit_item' => __('Edit Generic Data'),
    'new_item' => __('New Generic Data'),
    'view_item' => __('View Generic Data'),
    'search_items' => __('Search Generic Data'),
    'not_found' =>  __('No Generic Data found'),
    'not_found_in_trash' => __('No Generic Data found in Trash'), 
    'parent_item_colon' => ''
  );
  $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => false,
    'exclude_from_search' => true,
    'show_in_nav_menus' => false,
    'show_ui' => true, 
    'query_var' => false,
    'rewrite' => false,
    'capability_type' => 'post',
    'hierarchical' => true,
    'menu_position' => 20,
    'supports' => array('title','editor','author','thumbnail','excerpt','trackbacks','custom-fields','comments','revisions','page-attributes'),
    'taxonomies' => array('category','post_tag')
  ); 
  register_post_type('gen_data',$args);
};?>

Now if you take a close look at this part:

    'publicly_queryable' => false,
    'exclude_from_search' => true,
    'show_in_nav_menus' => false,
    'query_var' => false,
    'rewrite' => false,
    'show_ui' => true, 

you can see that we set the post type to have a ui and to show in the admin menu but other then that its "none public".

so you can create your portfolio posts using this post type or any other "generic data types" that need post capabilities.

share|improve this answer
    
Ok, this solution for copyrights is grate, but if I wanna something bigger to display on my template? For example some "tour dates" table? I wanna display it just in footer (or whatever). Creating "page" and displaying into footer template is very good solution, but I don't wanna create permalink www.mysite.com/tourdates –  Kaspars Mar 9 '11 at 13:30
    
any page will get a permalink automatically, you can change it to what you want but you can't avoid it, also options table can hold your "tour dates table" data and you can even create an option page to updated it and even use the TinyMCE editor, creating a page to hold data for something other then a page is simply a wrong approach. –  Bainternet Mar 9 '11 at 13:39
    
Ok, but take a look on this example - img34.imageshack.us/i/examplecj.jpg . The best way ( or not? ) is to create new category and add 6 new post to that category. Than client can easily add new post to that category only entering the title and image. And then it will show on this page 7 items. But bad thing is, that wordpress will also create post permalinks, witch I dont wanna. So have you would solve this problem? –  Kaspars Mar 9 '11 at 14:01
    
So I mean if I create just page and add the content in 3x2 table for me it would be ok, when client would wanna to add new "product" in that page, it would be hard for him. Easier for him would be to create new post ( add the title and image) and select the category. And that "product" would show into that page. –  Kaspars Mar 9 '11 at 15:08
    
I updated my post with "better" example –  Kaspars Mar 9 '11 at 15:54
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.