Forum Replies Created

Viewing 15 replies - 391 through 405 (of 415 total)
  • Ah, now that I don’t know.

    There is a plugin (called Convert Post Types) that will convert posts into custom post types. At least that way you can convert all of your normal posts to custom ones and then have them hierarchical.

    If you go that route, don’t forget that you’ll need to do a custom WP_Query() each time as the standard query only does regular posts.

    Peter

    What do you mean by “hierarchical”? A drop-down menu with sub-menus is “hierarchical”. Do you perhaps mean alphabetical?

    If so, you need to modify your WP_Query() to something like this:

    <?php $query = new WP_Query( array ( 'orderby' => 'title', 'order' => 'ASC' ) ); ?>

    If you don’t have a WP_Query() in your code, then add it before the line that says <?php if ( have_posts() ) : ?>

    Hope that helps

    Peter

    PS: Here’s the reference in the Codex for WP_Query()

    Forum: Fixing WordPress
    In reply to: Jolieme.com

    In your dashboard, go to Plugins > Add New and search for “private members area”.

    I’m not entirely sure why you would want to do that!

    If you want to contain the sidebar in a fixed size and have the contents scrollable, all you need do is change the container div’s CSS so that it has a fixed height and add overflow-y: scroll;

    So, for you it would be:

    #sidebar { height: 500px; overflow-y: scroll; }

    Hope that helps

    Peter

    Here’s how I do it with a modified WP_Query:

    <?php $args = array(	'post_type'	=> 'events',
    			'post_status'	=> 'publish',
    			'order'		=> 'ASC',
    			'orderby'	=> 'meta_value',
    			'meta_key' 	=> 'event-date-start' ); ?>
    <?php $eventslist = new WP_Query(); ?>
    <?php $eventslist->query( $args ); ?>

    The important bit is meta_key which tells it to look at the custom field called ‘event-date-start’ (in my case, yours will no doubt be different!)

    Hope that helps

    Peter

    Here’s a strange thing then.

    In my ignorance (having never heard of this issue) I created a page called “events” and a custom post type also called “events” and haven’t ever had any problems with it!

    I’m currently using WP 3.1.3 and use Custom Post Type UI plugin 0.7. Permalink structure is set to /%category%/%postname%/. Only other thing I can think of that might effect this is SEO Ultimate.

    Am I lucky or have they fixed this? It must be said, though, that I don’t use pagination but the URLs work perfectly.

    Peter

    Did you get the name of the header .php file right? get_header('header2') would look for a file called header-header2.php!

    Sorry, you said that you had the option to select a language, so I had assumed that you had implemented that yourself. Without being able to see your theme’s .php files, it’s impossible to know how the language choice is being selected and stored.

    It does look like you’re using the QualiFire theme, perhaps you should go back to them and ask.

    Sorry I can’t be more helpful.

    Peter

    Assuming you have a variable to store the chosen language (let’s call it $myLang for sake of argument) all you actually need to do is to create different header.php files, named with the language in them as follows: header-fr.php and header-co.php (Change the codes that I’ve used here for what you’re actually using, I’ve called French fr and Croatian co).

    Now, in your site’s PHP file, wherever you see the code get_header() change it to get_header($myLang) and there you go.

    Hope that helps

    Peter

    There is a simpler way as the get_header() function accepts a name, which will call in an alternative header file.

    eg – get_header() loads the standard header.php but get_header('home') will load header-home.php

    Are you doing your own WP_Query call?

    If not, then WordPress will already have done this for you, say on a single page or post, in which case it will already have filtered out all other posts, so you will only get the one. The only time using query_posts will work like that is in an archive or categories or search display.

    You need to do your own query from scratch. You shouldn’t do this in the standard single.php or page.php otherwise it won’t work properly for when you do need to display single posts.

    Rather, you should make your own page template file. Your PHP for that will then look something like this:

    <?php rewind_posts(); ?>
    <?php $recent = new WP_Query(); ?>
    <?php $recent->query("p=1,2,3,4,5"); ?>
    <?php if ( have_posts() ) : ?>
    <?php while($recent->have_posts()) : $recent->the_post(); ?>
    
    ...
    
    <?php endwhile; endif; ?>

    Yeah, so you’ve got the postid-393, which is the unique identifier for that particular post. How about if you’re viewing a category post? It might have something like catid-5 or something (I tend not to use categories to differentiate my posts, so I can’t be sure!)

    If you want to see the principle in action, have a look at this site of mine: planetearthinstituteworldwide.org – I use this method to change the background image of the whole page depending on the section you’re viewing as well as the heading colours to match (click your way through the menus top menus to see).

    Have fun!

    Peter

    Personally, I wouldn’t do it like that – there’s a far simpler way of doing it using CSS. But, only if your theme adds semantic classes to your <body>.

    Using these semantic classes you can change the style of objects depending on which page you’re viewing. Your logo could then be displayed using a background image rather than an IMG tag.

    For example, in your header.php file your would have:

    <div id="logo"></div>

    In your CSS you would then have:

    #logo {background: url(mainLogo.jpg);} /* for all other pages */
    .pageid-1 #logo, pageid-2 #logo, pageid-3 #logo, catid-23 #logo {background: url(subLogo.jpg);} /* for the pages you want to change */

    These CSS classes might be different in your theme, so just have a look at the pages in your browser and look at the source to see what they should be.

    Hope that helps

    Peter

    Your question is a little short on specifics.

    1. have you use query_posts outside of the while loop? It must be called before the loop starts or you’ll get into a right mess.
    2. have you actually called the loop and included the HTML to display the results? query_posts on its own won’t display anything!

    Have a look at the Codex entry on the subject.

    Finally, query_posts is an inefficient way of including posts, you should really consider building the query into the main WP_Query call instead.

    Hope that helps

    Peter

    I think Jonas got the wrong end of the stick – what you’re looking at is an UI convention called “tabs”.

    The content is all loaded on the one page, but all but the current “tab” is hidden. jQuery (most likely) is then being used to show the content that you want to view when you click on the relevant tab and hide the others. The tab plug-in will also change the look of the current tab by changing the tab’s CSS.

    A quick search in Google/Bing/etc for “jQuery tabs” will bring forth a whole load of stuff on the subject, from simple jQuery plug-ins to how to create your own code.

    Have fun!

Viewing 15 replies - 391 through 405 (of 415 total)