Forum Replies Created

Viewing 5 replies - 16 through 20 (of 20 total)
  • the above code also fixes the problems with wrapping the text around your photos in your blog posts

    Hi mpandeha11,

    It’s really simple: you are probably using a plugin that modifies some of your css. The problem comes from the fact that your <p> tags have “display:inline-block” when they should be “display:block”. Please go to the css editor of the theme you are using and paste this:

    p{display:block!important}

    I hope this answers your question!

    Hi there,

    do you have a link to this page that you can share with us? Try going to “Settings” > “permalinks” and press the “save changes” button (without doing any changes to it)

    Hi Christian,

    Here, I made a shortcode for you:

    Go to wp-content > themes > the directory of the theme you are using. Open up “functions.php” scroll to the very end and before the final “?>” add this:

    add_shortcode( 'gcc-list-pages', 'gcc_attorney_posts' );
    
    function gcc_attorney_posts( $atts ) {
        extract( shortcode_atts( array(
            'category' => 'Category Name',
        ), $atts ) );
    
        $args = array(
    	                    'post_type' => 'page',
    	                    'tax_query' => array(
    		                    array(
    			                    'taxonomy' => 'category',
    			                    'field'    => 'name',
    			                    'terms'    => $category,
    		                    ),
    	                    ),
                        );
    
        $query = new WP_Query( $args );
        if ($query->have_posts()) :
            $html = '<ul>';
            while ($query->have_posts()) :
                $query->the_post();
                $html .= '<li><a href="'.get_the_permalink().'">'.get_the_title() .'</a></li>';
            endwhile;
            $html .= '</ul>';
        endif;
    
        wp_reset_query();
        return $html;
    }

    Then go to any page/post you want and paste this in the editor:

    [gcc-list-pages category="your category name"]

    (don’t forget to replace “your category name” with the actual name of your category)

    After this the styling is a pure css matter that is dependent o your theme’s style.css file.

    Don’t forget, if you want to be able to update your theme in the future without loosing these changes you need to work on a child theme.

    Also I don’t understand your question about arranging “these lists into tabs”. Do you want each page name to be a tab and then when you click on a tab to be able to view the page’s content?

    Thread Starter supportyourwp

    (@girlscancode)

    Thanks Nick, awesome plugin, by the way!

Viewing 5 replies - 16 through 20 (of 20 total)