WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Customise widget (3 posts)

  1. macrocurio
    Member
    Posted 1 year ago #

    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'
    						)
    					)
    				);
    }
  2. bcworkz
    Member
    Posted 1 year ago #

    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.

  3. macrocurio
    Member
    Posted 1 year ago #

    Thanks for that, I'll keep trying :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.