Trigger a class to hide meta-data of posts on WordPress blog page - wordpress

Basically on my bakery's WordPress blog page http://www.omigretchen.de/novedades/ I would like to hide the meta data displayed below each post preview. Usually I always succeed in using the console and trigger the class.
As it shows in this case I use a display:none on the class .entry-meta. Nevertheless it does not work. Does anyone has an idea what to do?

Are you certain that you've added .entry-meta { display: none; }? Because I don't see it. Make sure you put it where it'll be printed to the page.
A better way to do it is by editing the archive.php and either remove or comment the code that prints the entry-meta block.

Related

How to create a landing page with the child theme

I have purchased MasterStudy theme for my website and It doesn't have a template with no header or footer to create a landing page. My question is: how can I create a page with such template via its child theme and use visual composer to add the content? Is this possible?
Not sure if I completely understood your situation, but I'll try to help anyway.
Have you checked all the Theme Options? Sometimes you can easily delete the footer and header through the Theme Options. In case you have and there's not an option to do so, the smart move would be to create a custom page to fit your needs. You'll find some information about how to do so right here http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
Remember that the visual composer only edits the content of the webpage per se, meaning, it can't modify the template structure (footer and header in this case).
Hope it helps!
Actually, the solution is much more simple than I thought. I resolved it by adding custom CSS to hide the header and the footer of the page by mentioning Its ID. Here is the Code I used >>
.page-id-2114 #header {
display: none;
}
.page-id-2114 footer {
display: none;
}

Removing meta information from posts on wordpress

I want to remove the post author and date on Wordpress posts. However, I'm not sure how to hide this information. I have tried the following. Appearance -> Customize -> Theme Options -> Single Post Settings and then adding the following snippet of code .single-post-meta{ display:none;} inside both Ad Code - Below Post Title and Ad Code - Below Post Content. However, this does not work. How to fix?
I found a good work around.
Appearances-> Editor -> Style.css
Style.css can fix most display problems. Specifically for my problem, I scrolled down to where it said .post-info {...} and changed the display tag from display: block to diplay: none.
Try putting that CSS code in Appearance -> Customize -> Additional CSS instead.

Trying to change CSS on New-Post page (WP-admin)

I’m inside the New Post page on WP-Admin, where you can create a new post.
At the right column, there’s the category selector, in which you select the category for that new post.
I have something like 15 categories, and therefore the category box is showing with a scrolling bar. Since I need to automate some post creation, I need all the categories to be visible right away, without having to scroll.
So I found the css file that manages the height of the category box (it’s inside /wp-admin/css/edit.css and //wp-admin/css/edit-rtl.css) and there I changed the CSS files to allow a bigger height by default on that box.
However when I open the new post page, it still shows the small box in categories, and when I see the CSS rule, the change I made is not visible. It’s like the CSS is cached or something. I already made sure that my browser is not caching it.
The problem I think it’s because the CSS rules are not pulled directly from CSS files, but from this file:
http://www.website.com/wp-admin/load-styles.php?c=0&dir=ltr&load%5B%5D=dashicons,admin-bar,buttons,media-views,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menu&load%5B%5D=s,widgets,site-icon,l10n,wp-auth-check&ver=4.7
That file seems to go and gather the CSS information from some place (which I assumed was the CSS files in the wp-admin/css/ folder, in which I could find the exact same CSS rules that were applied to the category box) but for some reason, it’s not retreiving the updated CSS file. Or something else is happening (Server side caching the PHP response and therefore retreiving all the time the old response?)
I wouldn't recommend tampering with core admin files, as any changes you make could be lost from a WordPress update.
The proper way to do it is through a custom function added to your theme or child-theme functions.php file:
add_action('admin_head', 'custom_admin_css');
function custom_admin_css() {
echo '<style>
/* remove scrollbar from categories panel */
.categorydiv div.tabs-panel { max-height: none !important; }
</style>';
}
Another options that will allow you to have CSS for individual pages is to use this OH header/footer plugin. Once you install the plugin you can then add your CSS in the header textarea of the pages admin. Just make sure you enclose your CSS within a <style></style> tag.

Wordpress show sub menu items on index page

I am using wordpress and on the page "sidebar.php" I have the following code:
<?php wp_list_pages('post_type=wiki&depth=1'); ?>
It works great but what I need to do it that what I click on a Menu item on the sidebar I need the sub items to display on the main page.
UPDATE:
What I basically need to do is to have the first level items on the left (As it currently is), and when those links are clicked then the sub items of those items will be listed on the index.php (main page).
I am using the wp-wiki plugin to display the pages as wiki pages but the actual but the list is the same, just showing as a different type:
post_type=wiki
Can anyone help please?
Thanks
<?php
wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&depth=0');
?>
There's several ways you can accomplish this. WordPress actually has an example of exactly what you're looking to do in the Codex. (link - the last example in that section, right above the "List subpages even if on a subpage" heading)
There's several ways to do this though - that's just one example. But that code above, you just pop into your sidebar.php file. You can also create a widget out of it. And as someone else mentioned, you can use the new menu system for WordPress (but you can indeed, make it dynamic.) But the above example in the Codex is the simplest method.
Actually, an easier method would be just to list all subpages and use CSS to hide and show the child items based on what page you're on. The classes are already set up for you. Just view your source code and you can see it. So you'd do something like:
`li ul.children {display:none; }
li.current_page ul.children { display:block; }`
and variations thereof.
What about using the new menu function in wp 3?
That way you could include your type with any sub page you want (won't be dynamic though) and then add your favorite javascript or good css to show those sub-pages.

Adding custom CSS to Drupal 7 to hide the message

I use my custom block for displaying a flash game at the front page of my Drupal 7 installation, but there is also the annoying message:
<div id="first-time"><p>No front page content has been created yet.</p>
<div class="item-list"><ul><li class="first last">
Add new content</li>
</ul></div></div>
below it and I can't remove it. Is there please a hook for adding custom CSS? In my module I would like to make the #first-time light grey or invisible.
I prefer not to add a blank content just to get rid of that text.
Thank you!
Alex
UPDATE:
I've added the following to my module:
function game_init() {
drupal_set_message('XXX init called XXX');
if (drupal_is_front_page()) {
drupal_add_css('#first-time {color: green;}', 'inline');
}
}
but don't see that CSS-code or XXX string inside my front page.
UPDATE2:
Oh, I had to clear the cache and now it works (the Drupal docs seem to be wrong here - there was written that 'inline' CSS is not cached...)
Hiding the CSS is the WRONG way of doing it. why did you created your content as a Custom Block?
you should create a "Page" and set this page as front page in the Configuration->Site Information.
Whatever. you can also use any of these options but is not recommended.
you can also also add a BlankPage by Adding only the Title(then hiding it in PHP on page.tpl.php)
you can add your css in /templates/themes/bartik.info
you can call drupal_add_css on the _init() hook of your custom module.
Blocks are used to display information in every page(although we can set to display only on certain pages). Say For Example. A Menu, or A Shopping Cart etc.
If you want to add some CSS for a module, you should use drupal_add_css()
Why not simply add this CSS to your theme?

Resources