Bryan Purcell
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: $post->ID returning '1'are only specific templates affected? can you post the code from those templates?
Forum: Fixing WordPress
In reply to: $post->ID returning '1'can you check out the current query in the affected sidebar.php? check out the global $wp_query from the sidebar.php? maybe there’s a rogue query that’s resetting things?
Forum: Fixing WordPress
In reply to: html code instead of site showing up until I go to dashboardAre you running any caching plugins?
Forum: Fixing WordPress
In reply to: $post->ID returning '1'Hello!
can you try
$post_it = get_queried_object_id();
to get the post?
can I also recommend an alternative? there’s this plugin Page Widgets – it’s totally awesome – it let’s you override the widgets on a per-page basis. You set the sidebar as normal, but there’s an area on the page/post edit view with the same widget area you’d find on the Appearance->widgets interface. It lets you override the global widget configuration for SPECIFIC POSTS.
Blows my mind.
You should try it out!
Forum: Fixing WordPress
In reply to: Related ProductsAwesome! I think we’re onto something!
php files are just text files that have a .php extension. when you start the file with ‘<?php’ the system knows to process it like a php file.
So all you’ll need to do is this: create a basic text file, but name it ‘functions.php.’ paste that code from my above code in there and you should be good.
place the functions.php file in the root of the child theme directory that you made – I think that should do it!
glad you’re sticking with it.
-BP
Forum: Fixing WordPress
In reply to: Related ProductsIt looks like you pasted the code in the style.css ? Like lorro said, you need to create a file functions.php in the child theme folder with the following code in it:
<?php /* * wc_remove_related_products * * Clear the query arguments for related products so none show. * Add this code to your theme functions.php file. */ function wc_remove_related_products( $args ) { return array(); } add_filter('woocommerce_related_products_args','wc_remove_related_products', 10);
That code should not be in style.css
Forum: Fixing WordPress
In reply to: Old Theme: error in footer, want to fixYeah – I think you may be right ??
Has a good writeup on what that error means – and how the theme dev isn’t using the prepare function properly. However, it’s not ALL bad, because in this perticular case, you’re not accepting any input from the user, so you’re not really at risk here.
Try changing the line to:
$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > %s", 1970));
That will sanitize the input (which in this case is hard coded) (You should be using a child theme)
That said, though, if the theme dev isn’t supporting it anymore, it’s probably time to find a new theme ??
Forum: Fixing WordPress
In reply to: Editor style url access?No, that file isn’t loaded on the frontend, so its address wont be visible to the outside world. If you name it a randomly generated code – that will make it very difficult for a bad guy to access it from the frontend. That said, unless you’re using SSL for the admin – I wouldn’t consider this a secure method of hiding data.
I’m also not sure why you’re concerned – I can’t see how a malicious user would be able to use a typical editor-styles.css to do any harm
cheers,
BryanForum: Fixing WordPress
In reply to: Why Am I Getting ALL Pages on Every Page?Strange – so you haven’t made any template changes to the theme? have you tried deactivating plugins temporarily to see if it fixes the problem? I’ve installed the mantra theme on my dev and can’t repeat this with basic pages.
Forum: Fixing WordPress
In reply to: Want to specify different colours for each menu item? Please help!For the caps, change the above to:
.main-navigation .menu-item–green > a {
font-family: Arial;
font-size: 18px;
float: right;
font-weight: bold;
text-transform: none;
}Forum: Fixing WordPress
In reply to: Can't access post in dashboardWho customized this theme originally? They would probably be the best person to ask. If that doesn’t work, I’d contact themeforest, the theme vendor.
Forum: Fixing WordPress
In reply to: Can't access post in dashboardWho customized this theme originally? They would probably be the best person to ask. If that doesn’t work, I’d contact themeforest, the theme vendor.
Forum: Fixing WordPress
In reply to: Twitter Widget Not WorkingWhy not use a WP twitter widget, instead of copying code into a text widget?
Forum: Fixing WordPress
In reply to: Can't access post in dashboardRight – now go back to Posts->Categories. What’s the number on the right hand column in the row for this category? Click on the number (if it’s 1 or greater) and that should show the content that’s getting pulled into the page.
No Problem, glad to help