Forum Replies Created

Viewing 15 replies - 301 through 315 (of 332 total)
  • Hi Brittany,

    The “older entries” link is displayed in your theme because you have the number of posts per page set to “2”. This loads the “older entries” and “newer entries” links in when necessary. To fix the presentation of this, add the following to your CSS file (style.css):

    .navigation { clear: both; display: block; }
    .navigation .alignleft { float: left; }
    .navigation .alignright { float: right; }

    This should resolve presentation issues. If you see some funny things in the “navigation” DIV, remove clear: both; from the .navigation style and add a <div class=”clear”></div> below the .alignleft and .alignright DIV tags. This would, however, require you to edit the HTML of your theme on index.php. The first part of this solution should resolve this issue.

    If you would like to disable these links altogether but aren’t comfortable editing the HTML of your theme, type the following instead of the above .navigation:

    .navigation { display: none; }

    I hope this helps. ??

    Cheers,
    Matty.

    Hi isl30fvi3w,
    When the error occurs, does it just say “Fatal error”, or is an error message displayed?

    If an error message is displayed, could you please post it here? This will help in potentially finding and fixing the error. ??

    Cheers,
    Matty.

    Hi haampie,
    Have you tried replacing add_option with update_option? While add_option just adds the option (which could return an error if the option already exists), update_option checks for the existance of an option, adds it if it doesn’t exist or updates it if it does.

    I hope this helps. ??

    Cheers,
    Matt.

    Hi haampie,
    If you rename your poll_installation() function, that should resolve your function declaration issue.

    I’d say, either rename it to something unique ( eg: haampie_poll_installation() ) or instantiate it from an object.

    I hope this helps. ??

    Cheers,
    Matt.

    Hi Dan,
    The WordPress loop is the code that starts with something like this:

    <?php if(have_posts()): while(have_posts()) : the_post(); ?>

    and ends with something like this:

    <?php endwhile; endif; ?>

    If you copy and paste the above code, and all code in between, from your index.php file into a blank txt file (and save it as a backup) and then copy and paste the same code from page.php and paste it in place of the code on index.php, you may be able to then see blog posts (as long as you have published posts).

    We have established, by looking at your website, that page.php is functioning correctly, as it is being used to generate your subpages.

    I hope this helps.

    Cheers,
    Matt.

    This comment is also super helpful: ??

    Hi Boo_77,
    I’ve had a brief look over the “Elegant Grunge” theme and have the following findings:

    The frames are added using a series of functions within functions.php. These are also controlled via an options panel, generated in the same file.

    If you copy and paste this functions.php file into your new theme (maybe renaming it and including it in the theme’s existing functions.php file via include(‘filename.php’);), the frames should get added to your new theme. You would just have to copy and paste the frame images from the Elegant Grunge theme as well. These shouldn’t be too difficult to locate within the theme. ??

    I hope this helps.

    Cheers,
    Matty.

    Hi dandaman2010,
    I looked over your website briefly and have one idea. My first point of reference would be your index.php file in your theme. All other pages should be using page.php, and they’re all working, thus the issue could more than likely be on index.php.

    If you could try making a backup of index.php and copying the loop code from page.php into index.php, you should be able to see posts being displayed (if the posts are set to “published”). They layout may not be exactly what you’re after, although getting the posts to display is the first thing, I s’pose. ??

    I hope this helps.

    Cheers,
    Matt.

    Hey katyjack,

    As I understand it, you would like a homepage that looks different to your subpage. If this is correct, you have two options:

    1. Use the is_front_page() conditional tag. Essentially, you would have both of the content layouts (homepage and subpage) in the page.php file. You would then run a conditional like this:

    <?php
    if ( is_front_page() )
    {
    INSERT FRONT PAGE CONTENT LAYOUT HERE
    } else {
    INSERT SUBPAGE CONTENT LAYOUT HERE
    }
    ?>

    This option only works if the layout isn’t too different. If it’s completely different, your other option is a custom template file.

    2. Custom template file. Create a copy of page.php and rename it to homepage.php, or something explanatory like that. At the top of homepage.php in the code, type:

    <?php
    /*
    Template Name: Homepage
    */
    ?>

    You now have a custom page template. ?? In WordPress, edit the page that you are using as your homepage. In the “Attributes” box, select your new template from the “Page Template” select box.

    This should now give you a custom layout for your homepage. ??

    I hope this helps.

    Cheers,
    Matt.

    Hi Boo_77,
    I am looking into this and will post again with my findings.

    Cheers,
    Matty.

    Awesome! Glad I could help. ??

    Did this solution work out?

    Hi staxx-x,
    A “quickfix” solution I found would be to add an empty option field on top of the file list when clicking “update list”. I did this by doing the following:

    Add html = html + '<option value="">-- No File --</option>'; above line 85 (which looks like this: html = html + '<option value="' + file['guid'] + '">' + file['post_title'] + ' (' + file['post_mime_type'] + ')</option>';) in more-fields-write-js.php.

    This is a temporary solution that has been tested briefly (not extensively at all). The plugin developers may have a more solid solution to this.

    Cheers, hope this helps,
    Matt.

    Hi Peetboy, jodineuf, teebru and musicmasteria,

    I’m not sure if this is the recommended solution by the plugin developer, but the following worked for me:

    – To resolve the Call to undefined method more_fields_object::rewrite_rules() error, replace $mf0->rewrite_rules(); on line 150 of more-fields-manage-boxes.php with $mf0->generate_rewrite_rules();

    – To resolve the “operand” error when adding fields, replace $wp_rewrite->rules = $new_rule + $wp_rewrite->rules; on line 768 of more-fields-object.php with $wp_rewrite->rules = $new_rule . ' + ' . $wp_rewrite->rules;

    Once again, these solutions worked for me in WordPress 2.8.3. The plugin developers may have better solutions than the above.

    Cheers,
    Matt.

    Hi ladydelaluna.

    As mentioned above, I’m not familiar with the construction of the Studiopress WordPress theme. When reading your original post above, the process looks, to me, like this:

    Goal: Display images of other posts in the same category(s) as the post currently being viewed.

    And the process:

    1. If the page being viewed isn’t a single post page, display the images as they are currently.

    2. If the page being viewed is a single post page, do the following:

    2.1 Determine the IDs of the categories the current post is categorised under.

    2.2 Use a custom SQL query to pull the values of all other posts in hte same categories into an array.

    2.3 If the query returns no results, display the images as they are on the homepage.

    2.4 Otherwise, if the query returns results, loop through and display the images within the results only.

    Using the first snippet of code above, we can modify it to read as follows:

    <?php
    if ( is_single() ) {
    // DO CHECKS FOR CATEGORIES, ETC
    } else {
    // DISPLAY IMAGES AS THEY ARE CURRENTLY
    }
    ?>

    Knowing this, we’ve solved step 1.

    Step 2 is clear, once the code is in place. The first part looks, in my mind, like this:

    <?php
    	$categories = get_the_category();
    
    	$category_ids = array();
    
    	foreach ($categories as $category) {
    		$category_ids[] = $category->cat_ID;
    	}
    
    	global $wpdb;
    
    	$sql = "SELECT
    				ID, post_title
    			FROM
    			" . $wpdb->prefix . "posts
    			JOIN
    			" . $wpdb->prefix . "term_relationships ON ID = object_id
    			WHERE
    				post_type = 'post' AND post_status = 'publish' AND ID != " . $post->ID . "
    			AND
    				(";
    
    	for ($i = 0; $i < count($category_ids); $i++) {
    		$sql .= " term_taxonomy_id = " . $category_ids[$i];
    
    		if ($i < count($category_ids)-1) {
    			$sql .= " OR ";
    		}
    	}
    
    	$sql.= ") GROUP BY ID ORDER BY post_date ASC";
    
    	$rs = $wpdb->get_results($sql, ARRAY_A);
    ?>

    Essentially, the above code handles steps 2.1 and 2.2. Steps 2.3 and 2.4 are a matter of running an IF statement that looks something like this:

    <?php if (empty($rs)) {
    // DISPLAY NORMAL IMAGES
    } else {
    // DISPLAY CATEGORY SPECIFIC IMAGES
    }
    ?>

    As I am unfamiliar with how the images are selected from the database and displayed, I am unable to code the image display itself. If this is using a WordPress custom field, it should have functions such as get_post_meta() in the code snippet, which should be quite clear to decipher and work through. ??

    I hope this helps. ??

    Hi ladydelaluna.

    Just popping in to let you know I’m working on this. I’m not familiar with the Studiopress theme, although I do believe I’m coming to a solution. Just have to test a few WP functions to make sure I’m on the right path with what I’m thinking for a solution. ??

Viewing 15 replies - 301 through 315 (of 332 total)