Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Matt25

    (@matt25)

    Thanks

    Thread Starter Matt25

    (@matt25)

    Yes I checked the Codex example, all seems fine to me.

    Here is the main section of code from the custom page that links the custom taxonomy:

    $args1 = array(
    	'taxonomy' => 'representedartist', // Registered tax name
    	'hide_empty' => false
    );	 ?>
    
     	<?php $artists = get_terms( 'representedartist', $args1 ); ?>
    
     		<?php foreach ($artists as $artist) { ?>
    			 <section class="artist">
    			 		<?php $artistName = $artist->name;
    			 				$artistID = $artist->term_id; ?>
    			 				<?php $term_link = get_term_link($artist); echo $term_link;?>
    			 		<a class="nostyle" href="<?php echo $term_link; ?>"><h2 class="artistName"><?php echo $artistName;  ?></h2></a>
    			 		<img src="<?php echo z_taxonomy_image_url($artist->term_id); ?>" width="400px" />
    			 		<p class="artistBio"><?php echo $artist->description;  ?></p>

    [Moderator Note: No bumping, thank you.]

    Thread Starter Matt25

    (@matt25)

    Solved, Just added my custom post type to WP_Query 🙂

    Thread Starter Matt25

    (@matt25)

    I have found that custom post types don’t show in queries automaticly thanks to http://designpx.com/tutorials/custom-post-types-author-archive/

    I have added the ‘$query->is_page_template’ part to try and get it to show on the page template, I am not sure if this is right or not but it is not working.

    function custom_post_author_archive($query) {
        if ($query->is_author || $query->is_page_template )
            $query->set( 'post_type', array('musicp', '3dill', 'post') );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('pre_get_posts', 'custom_post_author_archive');

    Just to clarify and simplify. I have a page which fetches all users of a certain role and then displays their posts(which are custom post types). When I add a post that is a custom post type it does not display as part of the users posts, nor does it show in the post count on the users table.

    Any help would be much appreciated.

    Matt

    Thread Starter Matt25

    (@matt25)

    Thanks for the reply. I am not using any member plugins.
    I have been changing some things and it seems it is only when I post into a custom post type that it doesn’t show as a post. When I post a standard post it works fine.

    Is there something I missed when setting up the custom post types?

    register_post_type( 'musicp',
    		array(
    			'labels' => array(
    				'name' => __( 'Music' ),
    				'singular_name' => __( 'Music' )
    
    			),
    		'taxonomies' => array('category'),
    		'public' => true,
    		'has_archive' => true,
    		'supports' => array( 'title', 'author','editor', 'thumbnail', 'custom-fields' )
    		)
    	);

    Thanks,
    Matt

    Thread Starter Matt25

    (@matt25)

    Thanks very much for the help, it seemed to have permanently slipped my mind about having to use http:// to get to an external site which was obviously stopping it. I have now put it into my code so you can’t not have it,

    Cheers for the help,
    Matt

    Thread Starter Matt25

    (@matt25)

    I have contacted my host but then I went and checked my local version of the site and it happens on that aswell, so it can’t be the host can it?
    Thanks, I really appreciate the help,
    Matt

    Thread Starter Matt25

    (@matt25)

    Yes I know, I tried deleting it but it appeared again for some reason.
    I have just tested and it seams any link i put into the template file does the exact same thing and has the site url put infront of it.
    Cheers,
    Matt

    Thread Starter Matt25

    (@matt25)

    I don’t know much about .htaccess but this is all I have in mine:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    and I can’t find any others. I have and it echos nothing outside of the loop so it can’t be already being used.
    Cheers,
    Matt

    Thread Starter Matt25

    (@matt25)

    I have tried that but its still doing it, I just can’t work out why wordpress would be inserting stuff into a hard coded url.
    Cheers,
    Matt

    Thread Starter Matt25

    (@matt25)

    Thanks, I have now got it to work. I do now have another problem though
    I need to make the image a link to the website of the bike but for some reason instead of going to Trek.co.uk it goes to http://wordpress.digital-spoon.co.uk/www.trek.co.uk
    again I can’t work out why though, this is my code

    $loop = new WP_Query(array('post_type' => 'Bikes', 'posts_per_page' => 10));
    while ( $loop->have_posts() ) : $loop->the_post();
    
    	$custom = get_post_custom($post->ID);
    	$bike_url = $custom["bike_url"][0];
    	$bike_img = $custom["bike_img"][0];
            $bike_price = $custom['bike_price'][0];
    
    ?>
    	<div id="bike">
    	<h1 id="bike_id"><?php the_title(); ?></h1>
    
    	<a id="bike_img" href="<?php echo $bike_url ?>"><img alt="<?php echo $bike_url ?>"  height="169px" width="192px" src="<?php bloginfo('wpurl'); ?>/wp-content/uploads/<?php echo $bike_img ?>" /></a>
    	<?php the_content();
            echo $bike_price;
            echo $bike_url; ?>

    Thanks,
    Matt

    Thread Starter Matt25

    (@matt25)

    Awesome thanks for that, it helped a lot and I have the pages and catagories set up how I want them now.

    The thing I am trying to work out now is that when I display the bikes on a multiple post page I want to have an image of the bike next to each of them. It seems the easiest way to do this is to enable the post thumbnails but I can’t get it to work with the custom post type, this is the code I have:

    add_theme_support( 'post-thumbnails', 'Bikes');
    set_post_thumbnail_size( 192, 169 );

    But it doesn’t seem to be coming up in the UI when I add a bike and I can’t work out why

    Thanks for the help,
    Matt

    Thread Starter Matt25

    (@matt25)

    I just thought it would be easier to just have ‘add bike’ on the dashboard rather than adding a post and it will make creating a blog if we wanted to easier in the long run. I have setup categories for the bikes custom post so I have the makes and things.
    Cheers,
    Matt

    Thread Starter Matt25

    (@matt25)

    In short, Yes.

    Basically what I want is that it is going to be like an e-commerce but without the e-commerce stuff in that It will all be categorised with the bikes different makes and things but it wont have a page to buy the bikes. So if I filtered out a all the Trek Hard tail bikes it would list all the Trek hard tails with a picture of it next each of them if that makes sense?
    Cheers,
    Matt

    Thread Starter Matt25

    (@matt25)

    I know, I have read that but at the moment, I can’t even change it to any of the other preset options in the permalink options. I have tried updating the ‘httpd.config’ and updated the directory so it displays:
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>

    rather than: AllowOverride none

    But it still doesn’t work

    How do you change the permissions on the file on a WAMP local server? I’m not sure what the htaccess files permissions are at the moment or how to change them.
    Thanks

Viewing 15 replies - 1 through 15 (of 15 total)