Bryan Purcell
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Want to specify different colours for each menu item? Please help!Good call, Evan!
Forum: Themes and Templates
In reply to: Pagination in Static PageCool! Glad to hear it’s working!
Are you referring to your original code? I think there were two issues
1. you were missing the ‘paged’ argument in your WP_Query call
2. you were loading the query into $query, which works, but you need to load it into $wp_query to use pagination. and, if you’re using the global query, it’s important to stash it away, then restore it when you’re done, which is what we’re doing with the temp query bit.Can you try this? (untested)
<?php $temp_query = $wp_query; $args = array( 'post_type' => 'post', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'ubicacion', 'field' => 'slug', 'terms' => array( 'ruperto-concha', 'estallido', 'vineta', 'vitrina', 'letrero', 'plenoempleo', 'primero' ), 'operator' => 'NOT IN' ), array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => array( 'las-informasiones' ), 'operator' => 'NOT IN' ) ) ); $wp_query = new WP_Query( $args ); /* Start the wp_query up */ while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_title(); ?> <?php the_content(); ?> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <?php $wp_query = $temp_query; ?>
OK – I see what’s going on. loading the post collection into $query, which is the wrong variable. You’re not overriding the default query, so all the posts are showing.
you need to rename $query to $wp_query.
one thing to consider is that without some extra provisions, pagination won’t work. It will show your max num of posts specified in the “Reading Settings” and that’s it. If you need help with that I can send over a code snippet that can help.
Forum: Fixing WordPress
In reply to: Can't access post in dashboardWhen you visit Posts->Categories, do you see a category for the faq martial arts?
Forum: Fixing WordPress
In reply to: Can't access post in dashboardHi!
OK – so it looks like https://www.peplending.com/category/martial-arts/frequently-asked-questions-martial-arts/ is not a “Page,” per se, but actually a category listing. You should be able to change what appears on that page by adjusting which posts are in the frequently-asked-questions-martial-arts category. Log in to the site, and visit the page. The top bar should read “Edit Category.” From that link you’ll be able to change basic things, like category name, but you’ll need to go to Posts -> Categories to see and edit the category assignments themselves.
let me know if you have any questions
Bryan
Forum: Fixing WordPress
In reply to: Want to specify different colours for each menu item? Please help!Alex, to change text color instead of background, change ‘background-color’ in the above code to just ‘color’ in the three classes.
What’s your site url? I’ll need that to take a look at your other requests.
OK – what’s the template code you’re using to render the output? What if you try a
var_dump($query)
right after it’s set to the WP_Query?Forum: Themes and Templates
In reply to: 1st ever custom theme, but with issues?Nice! Glad to hear it
I don’t see anything wrong with the code – can you simplify this query to try to see where it’s failing? Does it work when you only have one of the tax_query conditionals?
Forum: Fixing WordPress
In reply to: Want to specify different colours for each menu item? Please help!ok – so this should be pretty straightforward if we go the classes route. The downside is that it’s not very easy to add new colors. But if you’re alright with that, we can proceed.
The first thing you should do is create a child theme, so updates you make are located in you’re own custom space. https://codex.www.ads-software.com/Child_Themes provides a nice explanation there.
would you like to adjust the background color of the menus? or the text color?
in the child theme’s style.css, paste the following rules in
.menu-item–red {
background-color: red;
}
.menu-item–blue
{
background-color: blue;
}
.menu-item–green {
background-color: green;
}Save it (make sure your child theme is the theme that’s active.
Go to Appearance->Menus, and click into your menu. Click “Screen Options” in the upper right, and make sure “classes” is checked. In the individual menu item edit area, you’ll see an input field marked “Classes” simply paste the name of the class from above that references the desired color. So, if you wanted to make the menu item background green , in this case, you’d paste “menu-item–green” into the Classes box for that menu item.
Let me know if you have questions.
Bryan
I think you want to go with AND for your relation?
'relation' => 'AND',
Forum: Themes and Templates
In reply to: 1st ever custom theme, but with issues?Hmm – yeah – styles in editor-styles.css will not appear on the frontend – that’s only loaded when you’re in the post editor. It looks like you’re editor-styles.css is loading properly, given the snippet you posted. Are you seeing the styles in editor-styles.css manifested on the “Add New Post” page editor?
Forum: Fixing WordPress
In reply to: Image with link code? [client][/client]What theme is this? that [client] shortcode is implemented as part of the theme, or as part of a plugin – I can’t say without knowing what theme you’re using. I also can’t say what arguments it can accept.
One quick way to do this would be to wrap the [client][/client] code in an anchor tag:
<a href="yourlinkhere">[client][/client]</a>
but it’s possible that there’s a feature in the [client] shortcode that lets you provide a link as an argument, ie
[client href="yourlinkhere" src='https://stoutwooninnovatie.nl/wp-content/uploads/ruwi-logo-stout1.png'][/client]
This looks like it’s a themeforest theme, so I’d recommend reaching out to them, if this is a feature bundled in the theme.
Forum: Fixing WordPress
In reply to: register_nav_menusFirst things first – create a child theme for your modifications – don’t edit the 2010 theme directly. Once you have a child theme set up, create a functions.php file in the child theme root directory, and place this in it:
add_action( 'after_setup_theme', 'your_theme_setup' ); function your_theme_setup() { register_nav_menu( 'your_menu_name', __( 'Your Menu Name', 'your-localization-string' ) ); }