Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter thomasgardner47

    (@thomasgardner47)

    Hello Joy

    Thank you for your reply.

    We have been looking at custom post types as they seem more organised. However, we would prefer to use friendly URL’s that follows a hierarchy, so it is important that we get around WordPress’ default behaviour of only allowing unique slugs.

    In our case any child/granchild categories with the same name shouldn’t be a problem if the parent category which will be unique is prefixed to utilise the full hierarcky in the URL, as shown below.

    https://domain.com/entertainment/gaming/~/post-name
    https://domain.com/guides/gaming/~/post-name
    https://domain.com/petitions/gaming/~/post-name
    https://domain.com/reviews-and-product-demonstations/gaming/~/post-name

    The way we would like the URL structure to work is to have an archive page for each level of the hierarcky. Once a post has been categorised as far down as possible in the hierarky the URL will finish with the post name.

    Thanks

    Thomas

    Thread Starter thomasgardner47

    (@thomasgardner47)

    Hello,

    As seen in the screenshot, the child theme is still coming in second place.

    [img]https://farm5.staticflickr.com/4712/39568048134_bfae247aff_k.jpg[/img]

    On line 1337 which is the parent theme this is coming above line 429 which is the child theme you can see that they are different. How would we go about fixing this?

    Thread Starter thomasgardner47

    (@thomasgardner47)

    On the athemes forum we was refered to the stackexchange forums, below is the code they provided to us.

    // Queue parent style followed by child/customized style
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX);
    
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/styles/child-style.css', array( 'parent-style' ) );
    }

    We assumed that we had to change some of the paramiters, so we ended up with this code

    <?php
    // Queue parent style followed by child/customized style
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX);
    
    function theme_enqueue_styles() {
        wp_enqueue_style( 'sydney-pro-ii', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'sydney-pro-ii-child', get_stylesheet_directory_uri() . '/style.css', array( 'sydney-pro-ii' ) );
    }
    ?>

    We have replaced the ‘/styles and changed it.

    Regards
    Thomas

    Thread Starter thomasgardner47

    (@thomasgardner47)

    Hello Andrew,

    We still want the parent theme to load, the authors of sydney pro did help us hugly, but we are still getting duplicates of the code. Below we have provided an example of the code, can you say if this is correct or not?

    <?php
    function my_theme_enqueue_styles() {
    
        $parent_style = 'sydney-pro-ii';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'sydney-pro-ii-child',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>

    Many thanks
    Thomas

    Thread Starter thomasgardner47

    (@thomasgardner47)

    Hello Andrew,

    I have edited the post which goes into further detail.

    Regards
    Thomas

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