Ramesh (thecodeisclear)
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: If not category, then add Author InformationHere is how I added the code in my
functions.php
fileif ( ! function_exists( 'twentyeleven_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * Create your own twentyeleven_posted_on to override in a child theme * * @since Twenty Eleven 1.0 */ function twentyeleven_posted_on() { if (! in_category('Political Artwork') ) { printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); } } endif;
Hope this helps.
Forum: Plugins
In reply to: [Timeline For Categories] [Plugin: Timeline For Categories] Error MessageThanks for the feedback. I will look into this issue. I had developed the plugin with a vanilla install of WordPress, so I didn’t get any issues. Let me get to the root of this ASAP.
Can you pls. list the other plugins that you had active/installed?
Forum: Fixing WordPress
In reply to: If not category, then add Author InformationSorry, I hadn’t got your question correctly the first time. Now, I see the text that you want to remove. This is provided by one of the theme’s functions – twentyeleven_posted_on()
In your
functions.php
file, find the functiontwentyeleven_posted_on()
and add the category check in there.If you enclose the entire printf within the
if
construct, the entire part of “Written by Admin. Posted December 1, 2011” would not appear. If you want to retain the “Posted” section, you will have to write a new printf in theelse
section.Forum: Themes and Templates
In reply to: Delete Part of ThemeI tested this on my Blog (https://justscribbl.in) and the border is removed. I checked your website and the style.css still shows the code for
background
. Did you update the file after editing?Forum: Fixing WordPress
In reply to: Microblog archiveAgain, if you are not averse to learning from similar plugins, this one should give you a good sense of direction
https://www.ads-software.com/extend/plugins/simple-microblogging/
Forum: Fixing WordPress
In reply to: Microblog archiveDo you already have data in microblog format? If so, how has that data been entered?
Somehow, I still feel that creating a custom post type and modifying the editor (maybe hide the entire editor and use the excerpt portion for input only) would work for you. I haven’t much experience with making such a change, but I found some links that (from the looks of it) seems easy
https://www.netmagazine.com/tutorials/create-wordpress-custom-post-type
https://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/Forum: Themes and Templates
In reply to: Delete Part of ThemeThe border is part of the background of the Header element. Go to your admin section. Under Appearance > Editor, Edit the style.css file of the theme “Box of Boom”. Search for the word site-title, you will see something like this below
#site-title { font-family: 'IM Fell English SC', serif; font-size:50px; padding-top:20px; padding-bottom:50px; text-shadow: 2px 2px 5px #000; text-align:center; background:url(library/images/title-sep.png) no-repeat center bottom; margin:0; }
Remove the line with the background parameter
background:url(library/images/title-sep.png) no-repeat center bottom;
. This will remove the border from your theme display.Forum: Fixing WordPress
In reply to: Microblog archiveIf the messages are of a specific post type (assume “message”), you can display all these posts via a custom loop.
Some reading material to get you started – https://codex.www.ads-software.com/Post_Types
Forum: Fixing WordPress
In reply to: If not category, then add Author InformationAw.. just realized it. You are missing a ?> in the first line. This should work
<?php if (! in_category('Political Artwork') )?> <p>Written by: <?php the_author_posts_link(); ?></p>
Forum: Fixing WordPress
In reply to: If not category, then add Author InformationThe exact code you have mentioned above, works fine on my test site. I added the code immediately after the printf line which outputs the tags, categories and permalink.
I also noticed that Twenty Eleven also displays an author bio (if the blog has multiple authors and the author details are updated in the profile). You could change that check with your check (on category)
<?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
can be replaced with
<?php if (! in_category('Political Artwork') ) :?>
Forum: Hacks
In reply to: New custom field in comments form does not appear for signed in usersThanks bcworkz. Though the issue was not related to the CSS, I was able to find the solution. I am adding it below so that others may benefit.
Earlier, I was using the fields array variable and appending my new variable to the element ‘url’ (under the fields array). The entire variable “fields” is not output when an user is already logged in.However, the element ‘comment_field’ under the defaults array will always be displayed.
$default[ 'comment_field' ] .= 'code for my new field here'
outputted the new field at all times. Marking this as resolved.
I am not an expert, but based on my reading of the codex and the hooks, I believe that you need to directly update the query string through your theme’s template.
Updating the $query object by assigning values to
category__in
along withpost_type
would try to get posts of type “post” or “media” restricted to category 312. Hence IMO, updating the query string is the way to your solution.If I am incorrect, pls. don’t hesitate to point out. I have just started learning and any feedback will be useful.