Forum Replies Created

Viewing 15 replies - 166 through 180 (of 345 total)
  • Thread Starter Equal

    (@equalmark)

    OK I have finally worked this one out. You need to add the following to your themes functions.php file:

    <?php
    add_filter('query_vars', 'add_new_var_to_wp');
    function add_new_var_to_wp($public_query_vars) {
        $public_query_vars[] = 'my_theme_custom_var';
        //my_theme_custom_var is the name of the custom query variable that is created and how you reference it in the call to the file
        return $public_query_vars;
    }
    add_action('template_redirect', 'my_theme_css_display');
    function my_theme_css_display(){
        $css = get_query_var('my_theme_custom_var');
        if ($css == 'css'){
            include_once (TEMPLATEPATH . '/style-options.php');
            exit;  //This stops WP from loading any further
        }
    }
    ?>

    Then call the php css file with the following in your themes header.php file inside <head>

    <link rel="stylesheet" href="<?php bloginfo('url'); ?>/?my_theme_custom_var=css" type="text/css" media="screen" />

    You should then be able to create a file called style-options.php which will be able to accept WP functions.

    Thanks to jeremyclark13

    Thread Starter Equal

    (@equalmark)

    I understand why the php file will not accept WP functions however studying the links you have provided I am not able to understand how to get the style-options.php file to accept WP functions.

    Could you explain a little further how this is done?

    Thanks

    Thread Starter Equal

    (@equalmark)

    Thanks for the quick response.

    So that code that is on this page is included in the themes functions.php?

    From memory (haven’t done this in a while) I think that the paths are always relative to the location of the file in which they are contained in. So as I have already said:

    The paths inside your Flash file are relative to where the .swf file is located itself

    Therefore if you .swf file is located in wp-content/uploads and your XML file was in the root of your site then the path inside the .swf file to the XML should be:

    ../../xmlfile.xml

    Again I think that the paths in your XML file are relative the XML file itself not the .swf file. An easy way (but not necessarily great) is to use absolute path everywhere!

    You can of course use Flash Vars, to pull the XML in the embed code rather than in the Flash File itself. This could mean that you could then change the XML file with a WordPress Custom Field, but maybe that is getting to complicated.

    Add it to single.php then in the same place.

    Are there any posts assigned to the dates of the archive? If there are no posts then the archive won’t show. For example if you were viewing the archive for 2009 but there were no posts written in 2009 then it would 404.

    Other than that try disabling plugins one by one to see if one gives the problem.

    If you mean you have copied your files from the web server then you cannot find your posts in there.

    All of your WordPress posts, pages, comments, categories, tags, custom fields and options are all stored in WordPress’ database.

    That page is therefore controlled by your themes index.php file. Therefore if you add the following:

    <p><a href="<?php bloginfo('url') ?>/news/">Read all news stories</a></p>

    before the end of the loop inside <div class="post"> it should do the trick.

    If you mean a ‘Theme Options Page’ then your best bet is to go and grab a free theme that has one and then pull it apart a bit and add to your site.

    If you mean how do you change your theme files then go to Appearance and Editor, and you can make changes there as long as you can write to the files on the web server.

    So have you got a page called ‘News’ and you have set this as your posts page in the WordPress ‘Reading’ setting page?

    I would start by taking a look at your functions.php file in your theme file and seeing if there is an error there.

    Thread Starter Equal

    (@equalmark)

    Don’t want to jinx it but I may finally have it. it seems to be working although usually I find something wrong rather quickly. This is what I have at the moment:

    <?php global $post; $thispage = $post->ID; // grabs the current post id from global and then assigns it to thispage ?>
            <?php $pagekids = get_pages("child_of=".$thispage."&sort_column=menu_order"); // gets a list of page that are sub pages of the current page and assigns then to pagekids ?>
            <?php if ($pagekids) { // if there are any values stored in pagekids and therefore the current page has subpages ?>
            	<ul>
            		<?php wp_list_pages("depth=1&title_li=&sort_column=menu_order&child_of=".$thispage); // display the sub pages of the current page only ?>
                </ul>
            <?php } else { // if there are no sub pages for the current page ?>
            	<p>There are no sub pages of this page.  What do you want to do?</p>
            <?php } ?>

    Fingers crossed 🙂

    Thread Starter Equal

    (@equalmark)

    I have recently changed from using the P2 theme on WPMU to using it on standard WP and it is now working no problem.

    Must be something to do with WP MU?

    Is the theme using the TimThumb.php script to resize the thumbnail images for you? If so it will be a problem with your permissions of the files and folders which Timthumb uses. That is usually the case for me.

    Try your web host company for support?

    I am currently having the same problem. Anyone got a solution to this?

Viewing 15 replies - 166 through 180 (of 345 total)