• Resolved macrocurio

    (@macrocurio)


    Hello,

    I’m currently modifying a clients site that was already setup with a theme. On the home page there is a widget that pulls the title and excerpt from a few posts and puts them in a slider (I have shown some of that code below). I just wanted to find out if it’s possible to have the first word of the title styled in a different way to the rest of the title.

    Cheers ??

    /* Slider */
    function my_post_type_slider1() {
    	register_post_type( 'extra-slider',
                    array(
    				'label' => __('Extra Slider'),
    				'public' => true,
    				'show_ui' => true,
    				'show_in_nav_menus' => false,
    				'menu_position' => 5,
    				'supports' => array(
    						'title',
    						'custom-fields',
    						'excerpt',
    						'editor'
    						)
    					)
    				);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    It may be possible, but the code you posted is not where it happens. You somehow need to filter the title content as it’s loaded into the slider and add span tags around the first word.

    Thread Starter macrocurio

    (@macrocurio)

    Thanks for that, I’ll keep trying ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customise widget’ is closed to new replies.