acub
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Customizr] Mobile nav shows not correctlyin CSS (panel or style.css of child theme):
@media (max-width: 979px) { .navbar .nav > li {display: block !important} }or you could wrap the lines from 20 to 52 in your child theme’s style.css in a @media condition:
@media (min-width: 980px) { // line 19 } // line 52Forum: Themes and Templates
In reply to: [Customizr] How I can disable the glow effect ?Add this to your custom CSS panel:
.gallery .gallery-icon img:hover { -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; box-shadow: none; }Forum: Themes and Templates
In reply to: [Customizr] Theme not respondingLeap, it’s pretty clear you messed up somewhere. So let’s start fresh.
1. Disable and delete your child theme and activate Customizr (or any other theme). Make sure that Customizr is updated to last version.
2. Create a new folder in your local copy of the site, under wp-content/themes/ and name it inStyle
3. Using a simple editor (notepad) create a new file and put this in it:/* Theme Name: inStyle Boutique Theme URI: http://www.instyleboutique.com.au Description: Theme for inStyle Boutique Author: Leapmkt Author URI: http://www.instyleboutique.com.au Template: customizr Version: 1.0.0 */4. Save this file in the inStyle folder as style.css (make sure encoding is set to UTF-8).
5. In the same folder, create another file, also UTF-8 with the name functions.php and put this in it, making sure there’s no empty space or empty line before the first character:<?phpAll the php snippets you’ll use for your website will go in this file, starting from line 2 (or 3). Line 1 needs to remain untouched.
5. Upload all the inStyle folder to your server (same path: wp-content/themes/)
6. Go to Dashboard > Appearance > Themes and activate your inStyle Boutique theme
7. Go to Dashboard > Appearance Menus > Manage Locations tab, select your menu and click “Use new menu”.You now have a working child theme, properly installed. Any css code you add to style.css will apply to your webpages and any php code you add in functions.php will also work.
Forum: Themes and Templates
In reply to: [Customizr] Recent blogs on a separate pageYou need to create two static pages for this. One for blog and one for homepage. If you don’t want any content under the featured pages on front page, leave content of the homepage empty.
Now go to Dashboard > Appearance > Customize > Homepage.
Select “A static page” as template. Select the static page for homepage and the one for blog page from the two corresponding drop-downs.Save and you’re done.
Forum: Themes and Templates
In reply to: [Customizr] Sort posts by updatetimeNote: Change
category-slugabove with the actual category slug.Another note: The first code is supposed to work, too, I don’t know why it didn’t in my tests. It might have to do with a bug on using is_category(tag_ID) on $wp_query, according to comments in this thread.
So basically it needs a check on whether the category with that id actually exists:
function sort_category( $query ) { if ( $query->is_main_query() && term_exists(314,'category') && $query->is_category(314) && ! is_admin() ) { $query->set( 'orderby', 'modified' ); } } add_action( 'pre_get_posts', 'sort_category' );where 314 needs to be replaced with the actual category ID.
Forum: Themes and Templates
In reply to: [Customizr] Sort posts by updatetimeI’ve tested the code above and is_category() conditional doesn’t seem to work during pre_get_posts. Only $query->is_category works, if you’re on any category page. I tried a few more methods and this one seems to work:
add_action('wp_head', 'sort_category'); function sort_category() { global $query_string; if ( is_category('category-slug') && is_main_query() && ! is_admin() ) $posts = query_posts( $query_string . '&orderby=modified' ); }Forum: Themes and Templates
In reply to: [Customizr] Sort posts by updatetimeYes, it’s possible. There are two requirements:
1. You need a child theme.
2. You need to know your category ID or the category slug. To find out the category ID go to your categories and hover over the edit category link. Watch the href displayed for the value of tag_ID.Now, add this code in functions.php of your child theme and replace {$cat_ID_or_slug} with either category ID or the category slug:
function sort_category( $query ) { if ( $query->is_category('{$cat_ID_or_slug}') && $query->is_main_query() && ! $query->is_admin() ) { $query->set( 'orderby', 'modified' ); } } add_action( 'pre_get_posts', 'sort_category' );I can’t test it right now. Get back to me if it doesn’t work. It should work, afaik is_category() is inside query.php, so it’s usable with pre_get_posts.
Forum: Plugins
In reply to: [Firelight Lightbox] custom inline form not workingFor anyone experiencing a similar problem. Just add name attribute to your form elements, not just ids. Turns out they are mandatory.
Resolved.
Forum: Themes and Templates
In reply to: [Customizr] How to include date of the post title or belowYou’re right.
Go to Dashboard > Appearance > Menus > Manage Locations Tab, select the menu you want from the list and click Use new menu.
Forum: Themes and Templates
In reply to: [Customizr] How to include date of the post title or below1. Create a new folder in wp-content/themes/, name it ViviDroid
2. Create a new file with any simple text editor (notepad) and put this in it:/* Theme Name: ViviDroid Theme URI: http://vividroid.com/ Description: Theme for vividroid.com Author: ViviDroid Author URI: http://vividroid.com/ Template: customizr Version: 1.0.0 */3. Save the file as style.css in your ViviDroid folder, and make sure it has UTF-8 encoding
4. Create a new file and put this in it:<?php add_filter('tc_show_post_metas' , 'display_metas_on_home'); function display_metas_on_home( $bool ) { return tc__f('__is_home') ? true : $bool; }5. Make sure there there is no empty space or any empty rows before the first character of this file. Save it as functions.php in the same folder, also with an encoding of UTF-8.
6. Upload the entire folder on your server.
7. Go to themes and activate ViviDroid.Your homepage posts should now have meta info displayed.
Note: In order for ViviDroid to work, you need to keep Customizr. Do not delete or alter it.
Forum: Themes and Templates
In reply to: [Customizr] Theme not respondingI see you solved your problem. However, I noticed another error you might want to get fixed: the nggimagerotation plugin has a jQuery script error and I’m pretty sure things are not working right with your current rotation.
You need to replace line 19 of wp-content/plugins/nggimagerotation/view.js from:});to:
})(jQuery);If it’s a plugin you got from WP repository, you should let authors know about this. If you made it, well, just update your view.js and it will work.
Cheers.
Forum: Themes and Templates
In reply to: [Customizr] link for slider without text and buttonIt’s a custom script and it uses the jquery.cycle library. You need to search your website source files for the text being cycled. I suspect it’s in a function placed in /wp-content/themes/{active-theme-folder}/functions.php
but it might as well be in a plugin (/wp-content/plugins/{some-custom-plugin}/).@narcopastello: you can’t pass category slugs to cat in query_posts, read the docs. Only ids work. Use -{cat_id} to exclude categories.
Example: &cat=1,3,-2 // includes posts from cats with cat_ids of 1 and 3 but not from cat with id of 2Or just use the array mode:
$args = array('cat' => array(1, 3, -2), 'paged' => get_query_var('paged')); // etc... query_posts($args);This way you can pass more complex params, like meta query parameters, order by postmeta values, only posts with custom meta set, etc…
I was just clarifying why query_posts is not usually the right solution.
Normally one should use this new WP_Query.$new_query = new WP_Query( $args ); if ( $new_query->have_posts() ) { // stuff before posts here while ( $new_query->have_posts() ) { $new_query->the_post(); // stuff for each post here } // stuff after posts here } else { // sorry mate, no posts } // reset post data to original wp_reset_postdata();And also, I was pointing out that if anyone is displaying content aware information in the sidebar, and the sidebar is left out of the custom query, it will output data for a page template, not for a post list template.
From WP’s point of view, the header, sidebars and footer of this template all know they’re on a page. The page you set the template for. If you want it to know you’re on a blog page, you have to extend the query accordingly, to include whatever you want it in (header, sidebars, footer, etc…). (In the case any of them displays different content on pots lists). To do that, move the lines 1 and 2 in the template, to include the parts you need.
query_posts is discouraged because it creates another instance of the main query. But in our case it is what we need.
Besides, it’s not efficient (does both the initial page query and, when it gets to the content it does a new one and replaces the first). And you also need to be pass the pagination from the list to the page.