Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter iamcanadian1973

    (@iamcanadian1973)

    Nick,

    Maybe ignore my messages. I’m somehow unable to reproduce the issue again.

    Maybe this was created by an update to WPML I made yesterday where there was some sort of conflict happening.

    Sorry to bother you.

    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    Also, are you sure you didn’t save as “feature a page” first. As your markup above shows a post ID of 423. But there would be no post ID if you were featuring a link and custom content instead of a page.

    Also from my earlier comment, the empty widget does show, but not the entry markup, That only shows if you first save as “feature a page” because you need to do that to get the post ID in the entry markup.

    I’ve tested this with no plugins installed but this one, and using just Genesis as the theme.

    So I might be crazy, but I swear this is how things are happening.:)

    $wp_query = new WP_Query( array( 'page_id' => $instance['page_id'] ) );
    
    		if ( have_posts() ) : while ( have_posts() ) : the_post();
    
    			genesis_markup( array(
    				'html5'   => '<article %s>',
    				'xhtml'   => sprintf( '<div class="%s">', implode( ' ', get_post_class() ) ),
    				'context' => 'entry',
    			) );

    In your code above, there needs to be a page id present in order to get the markup. Otherwise the loop won’t run.

    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    Hi Nick,

    Sure thing.

    Once you feature a link, the empty widget does show. Sorry, I should have been more specific.

    Then add in some custom content in the field provided.

    Hit save, and the only thing that shows on the front end is still the structure.

    Unless I select feature a page, and then hit save, the custom content does not show.

    Thanks for the plugin. Any chance there might be a widget in the works for Facebook feeds?

    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    These plugins are awesome, but to me look like they are over complicating things.

    I guess it’s juts a wish that WordPress core could validation a custom field, when it’s now part of the core to add custom fields.

    Forum: Fixing WordPress
    In reply to: custom post types
    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    OK, learning the WordPress style of doing things.

    add_action('admin_head', 'removemediabuttons');
    
    	function removemediabuttons()
    	{
    		global $post;
    
    		if($post->post_type == 'products')
    		{
    			remove_action( 'media_buttons', 'media_buttons' );
    		}
    
    	}
    Forum: Fixing WordPress
    In reply to: custom post types
    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    Here’s a solution. Maybe someone who knows WordPress can come up with a better one. I only started using WordPress 2 days ago so I don’t totally understand the WordPress way of writing code.

    $registered_custom_types = array('product');
    
    	add_action('admin_head', 'removemediabuttons');
    
    	function removemediabuttons()
    	{
    		global $registered_custom_types;
    
    		$post_type = null;
    
    		$post_id = 0;
    
    		if( isset($_GET['post_type']) ) {
    			$post_type = $_GET['post_type'];
    		}
    		else if( isset($_POST['post_type']) ) {
    			$post_type = $_POST['post_type'];
    		}
    
    		if($post_type)
    		{
    			if(in_array($post_type, $registered_custom_types))
    			{
    				remove_action( 'media_buttons', 'media_buttons' );
    			}
    		}
    		else
    		{
    
    			if( isset($_GET['post']) ) {
    				$post_id = $_GET['post'];
    			}
    			else if( isset($_POST['post']) ) {
    				$post_id = $_POST['post'];
    			}
    
    			if($post_id)
    			{
    				$post = get_post($post_id);
    
    				if(in_array($post->post_type, $registered_custom_types))
    				{
    					remove_action( 'media_buttons', 'media_buttons' );
    				}
    
    			}
    		}
    	}
    Forum: Fixing WordPress
    In reply to: custom post types
    Thread Starter iamcanadian1973

    (@iamcanadian1973)

    Thanks jkovis

    I was thinking more about this last after i walked away from the computer, and was thinking that would be a solution.

    I was just hoping there would be a function like is_custom_post_type()

    or something non related that might do the same thing.

    The problem is, when you edit the custom post, the get variable post_type is nit there in the url.

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