Big Bagel
Forum Replies Created
-
Forum: Themes and Templates
In reply to: What theme is this?That site’s using this premium theme:
Forum: Plugins
In reply to: User PrivilegesYou can set a page/post as private (only admins and editors can view it) or password protected.
If you’re looking for further options, such as making a post/page available only to specific users, there are plugins that might help. This one for example:
Forum: Fixing WordPress
In reply to: function get_current_screen Can it use by themes/functions.php?Unless I’m mistaken,
get_current_screen
is only intended for use when showing an administration screen. Its function is to return the current screen’s hook suffix. If you want to explain what you’re trying to do, I (or someone) might be able to provide a good alternative.Forum: Fixing WordPress
In reply to: Hide home link on homepage..Assuming I’m understanding correctly, you want to remove that bit of code on your static front page? Checking the current page with
is_front_page
like this should work:<?php if ( ! is_front_page() ) { ?> <div class="machines-banner"><a href="https://www.gotodesigns.co.uk/"><img src="<?php bloginfo('template_directory'); ?>/images/header-banner.png" title="home"</a></div> <?php } ?>
Forum: Fixing WordPress
In reply to: Next/previous page not working for custom post types only$query_string
should already contain the properpage
parameter; try tossing it into your query parameters:global $query_string; query_posts( $query_string . '&post_type=site_updates&post_status=publish&posts_per_page=50' );
Forum: Fixing WordPress
In reply to: Old Email Addy Attached to Login and Don't Remember PasswordThis page should help:
Forum: Fixing WordPress
In reply to: login required to see website as a public!!There’s no built-in feature/option that would lock down a site like that. Can you give a link to the site?
Forum: Fixing WordPress
In reply to: Falat Error with pluginTo remove the problematic plugin, use an FTP client or a file viewer provided by your host to delete its folder (
wp-content/plugins/buddypress-remove-avatars
).Forum: Fixing WordPress
In reply to: Author's PageNow knowing want you’re looking to do, I would think using
get_users
or theWP_User_Query
class would be easier.Function Reference/get users
Class Reference/WP User QuerySomething like this perhaps:
$args = array( 'exclude' => array( 1 ), 'who' => 'authors', 'orderby' => 'display_name' ); $authors = get_users( $args );
But if you really want to use a custom query, you’ll need to do as wspencer said and use
ORDER BY
. Since user names/display names aren’t kept in the posts table, you’ll have to find a way to use the users table. Might be as simple asORDER BY $wpdb->posts.display_name
, or you might have to look into joins. You could also run a separate query on the users table then only display users that have ID’s in both results. I’m not much of an SQL expert. ??And just an aside, if you’re only grabbing data from a single column, you can also take a look at
$wpdb->get_col
:https://codex.www.ads-software.com/Class_Reference/wpdb#SELECT_a_Column
Forum: Fixing WordPress
In reply to: Checking if the User is AdminI completely agree with using whatever works and pulling the adsense bit out while testing. ??
However, if the goal was to hide the adsense code on the front end from administrators,
if ( ! is_admin() )
wouldn’t work. It would always evaluate as true for any front end page regardless of the role of the current user.At the very least, whatever code cloudstr210 is now using resolved his problem, which is awesome sauce. ??
Forum: Fixing WordPress
In reply to: Checking if the User is AdminBut,
is_admin
just checks if the request was for an administration page. From the inline documentation:Does not inform on whether the user is an admin! Use capability checks to tell if the user should be accessing a section or not.
Forum: Fixing WordPress
In reply to: quick question about site description?That’s just for the title and description that actually show in your website’s header. The things All in 1 SEO adds are in your site’s head; stuff that isn’t shown on your site but is used by browsers and search engines.
Your
site-description
div isn’t empty either; it’s displaying whatever you set “Tagline” to be in “Settings->General”. Currently, that seems to be “London Based Calligrapher Serving Calligraphy Nationally”. I would imaging if you weren’t using an image and hadn’t changed the code for thesite-title
div, you’d also see whatever you set “Site Title” to be.Forum: Fixing WordPress
In reply to: Checking if the User is Admin…I just want to check if the user is admin…
Are you trying to check if an administration screen is being shown or if the current user is an administrator? If it’s the latter, then you want something like this:
if ( current_user_can( 'manage_options' ) ) { /* A user with admin privileges */ } else { /* A user without admin privileges */ }
Forum: Fixing WordPress
In reply to: quick question about site description?What is the specific code you’re looking at in
header.php
?Forum: Fixing WordPress
In reply to: quick question about site description?Everything looks fine to me. I don’t see any duplicate or empty items in your site’s head.