Posting to specific pages: child theme code and shortcode plugins not working

  • WestCountyWinds

    #8101

    I am new to Graphene, and attempting to assign specific post categories to specific pages. Custom menus are not an option for what I want to accomplish.

    I read the forums extensively, first creating a child theme and putting in place code for assigning specific categories to specific pages. It didn’t work. To test if the code was working at all, I typed text at the top of the file as a filler– upon reloading the page, the text would briefly flash at the top before loading an absolutely unchanged page (no posts from a designated category as specified in the code).

    EXAMPLE:

    <?php
    global $graphene_settings;
    get_header();
    global $wp_query;
    $cat = 23; // This should be the ID of the category to display the posts from
    $args = wp_parse_args(array('cat' => $cat, 'paged' => get_query_var('paged')), $query_string);
    query_posts($args);
    $wp_query->is_home = true;

    get_template_part('loop', 'index');

    get_footer(); ?>

    IF I ADD:

    TESTINGTESTINGTESTING
    <?php
    global $graphene_settings;
    get_header();
    global $wp_query;
    $cat = 23; // This should be the ID of the category to display the posts from
    $args = wp_parse_args(array('cat' => $cat, 'paged' => get_query_var('paged')), $query_string);
    query_posts($args);
    $wp_query->is_home = true;

    get_template_part('loop', 'index');

    get_footer(); ?>

    Then that added text shows up for a split second, confirming that something is working, if only partially.

    As an alternative to this route, I then tried 2 different plug-ins, Display Posts Shortcode and List Category Posts, neither of which is working. I enter a single form of shortcode, nothing happens.

    Such as

    [display-posts category="upcoming-concerts"]

    and nothing happens.

    I attempt another form of short code corresponding to whichever plugin is activated, nothing happens.

    I have tried only having one plugin active at a time, it makes no difference.

    I unfortunately cannot provide a link to my site because I am rebuilding it on my computer and haven’t pointed the DNS to it yet.

    Any thoughts?

    -Megan 🙂

    Mod

    Kenneth John Odle

    #40346
    Quote:
    attempting to assign specific post categories to specific pages.

    What do you mean by this? Categories are applied to posts, rather than pages. Are you trying to display only certain categories of posts on that page? If so, try using Kalin’s list plug-in or the category archive.

    WestCountyWinds

    #40347

    Thanks for your quick reply Kenneth! Unfortunately, this isn’t quite what I’m looking for.

    Yes, I am looking to assign posts that are within a category to appear on designated pages.

    So, I see that you listed another plug-in. My problem is that NO plug-ins have worked thus far that require shortcode to be entered regarding specific posts showing up on the page in which the category shortcode is inserted. I need a bit more of a brainstorm as to why this is happening.

    According to many other recommendations around this topic, including the developer’s, the child theme additions should have definitely worked, and they didn’t.

    I am figuring there may be specific options I need to change, other plug-ins that may be interfering, etc, but I don’t know where to look to problem solve this and hope someone else has an idea.

    Mod

    Kenneth John Odle

    #40348

    If shortcodes aren’t working, it may be a plugin conflict. The solution is to temporarily disable other plugins to see if this is the issue.

    WestCountyWinds

    #40349

    I disabled all other plug-ins and still the same result. 🙁

    Could the child theme be interfering?

    Thanks!

    -Megan

    Admin

    Syahir Hakim

    #40350

    Try this:

    <?php
    global $graphene_settings;
    get_header();

    global $wp_query;
    $cat = 23; // This should be the ID of the category to display the posts from
    $args = wp_parse_args( array( 'cat' => $cat, 'paged' => get_query_var( 'paged' ) ), $wp_query->query_string );

    query_posts( $args );
    $wp_query->is_home = true;

    get_template_part( 'loop', 'index' );

    get_footer();
    ?>

    WestCountyWinds

    #40351

    Thank you for your help Syahir!

    Unfortunately, this didn’t work either 🙁

    -Megan

    Admin

    Syahir Hakim

    #40352

    Please provide the URL to where the page is so that we can take a closer look.

    WestCountyWinds

    #40353

    Sorry for the late response!

    I just started working on the site again today.

    Turns out that the shortcode works when NO child theme exists, but if there is one, nothing works.

    So I deleted the child theme and will mark this thread as resolved.

    If you’re still interested in viewing the site, you’ll need to change your host file to point my IP address to a domain since I haven’t changed my DNS yet.

    Here are the instructions:

    If you are Mac OS User:

    1) Open the Terminal.app. Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.

    2) Open the hosts by typing on the Terminal that you have just opened:

    $ sudo nano /private/etc/hosts

    Type your user password when prompted.

    3) Simply append the line:

    198.187.29.62 westcountywinds.org

    4) Save changes, check web-site in a browser. When done editing the hosts file, press control-o to save the file. Press enter on the filename prompt, and control-x to exit the editor.

    That should do it!

    If you need the PC code, let me know. I’ve changed this ticket to resolved.

    Thanks!

    -Megan

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.