Articles of content

How to add custom page elements to the WYSIWYG editor?

On a plugin-less Worpress installation the WYSIWYG editor allows to write a page down from top to bottom with style buttons (lists, font, italics, bold, add picture …). What I am missing is the possibility to define custom page elements. Example: a button next to “Add picture” that is labeled “Add box” and does, well, […]

Different site different div content – Multisite

I have created numbers of websites. They are www.example.com, subsite1.example.com, subsite2.example.com and subsite3.example.com. I want to make a div that show different content. The example below is what i wanted. Example: (this may not a correct code. But was trying to tell what i’m asking in this question). <?php if (is_site1()) { ?> <div class=”div”> […]

How should I structure complex content hierarchies?

I am pretty new to WP and I have not had to deal with any overly complex content structures as of yet. Until now. I’m trying to figure out the right mix of Custom Post Types, Taxonomies, Pages, etc. to effectively display and organize the content. Here’s an example of content with a deep hierarchy […]

append one page content into another

I need to append the content of one page into this one. I have tried to use a plugin which is very easy to use but doesn’t work in my case. Then I found following code: <?php $recent = new WP_Query(“page_id=**ID**”); while($recent->have_posts()) : $recent->the_post();?> <h3><?php the_title(); ?></h3> <?php the_content(); ?> but it adds only the […]

If user is logged-in display/hide something

I want to check at page load if the user is logged in or not and hide the login mask I programmed accordingly. There is a reason I’m using said login mask instead of redirecting to the WordPress standard login. The idea was to use functions.php: if ( is_user_logged_in() ) { echo ‘<li id=”text-2″ style=”display:none;”>’; […]

Remove empty rows from the database

I’m writing a script to alter the post content column in the database and I just notice it has a lot of empty rows, these seem to be deleted posts that now have no content or anything, I don’t like them. Could i just DELETE from posts WHERE content = ”; without breaking anything? The […]

Changing theme removes page content in dashboard's post main editor

My client’s old site used some theme X. I created a child theme Y of some parent commercial theme Z. When viewing the admin page of a certain page while old theme X is activated, I see its content in main editor. But if I switch to my child theme Y, content is gone: http://goo.gl/czGLAa […]

A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom

Everything was working well, but somebody wrote a post with the following inside: <iframe blablabla (a video) </iframe> <div style=”clear: both; height: 3px; width: 592px;”></div> I think that clear: both was causing that the sidebar was being moved to the bottom as the following image displays: I added the following code to the css of […]

Adding Template Post Content

I’ve tried searching for this using various terminology, but I always end up at questions pertaining to the php template files. That’s not what I’m looking for, so I’m asking a new question. I apologize if this is a duplicate. Basically, I’m looking for a way to create template posts. I’m using ACF Pro on […]

Adding Custom CSS with PHP

I am creating a WordPress plugin to help people protect their content from being copied. There are many plugins to protect content from being copied when JavaScript is on, but no plugins which protect content even when JS is off. How can I add the following custom CSS code in a PHP file, to protect […]