Split content into multiple columns using more tag?

First of, this is pretty much an exact duplicate of: Split columns into three+ divs? But the given solution does not work (returns blank). I'm guessing it collides with qTranslate which adds some really weird comments to the html, but i'm not sure. I found a great code snippet that simply splits the content into pieces by the more tag. The problem is it seems to only split into two columns. It ignores the rest of the more tags. I …
Category: Web

Split database on large site?

What will be best way to split large database on single site, not multi-site wp installation? HyperDB is maybe for this (just, less than 10 webmasters managed to figure out how to install it, according to active installs). Currently site has about 350k posts, it is on good VPS. Site is running quite fast in fronted, opening pages, browsings... But it slows down at back-end when publishing new posts, every day lots of new posts are added. Site has this …
Category: Web

How is the Page Splitting implemented in the theme?

I am studying how the page splitting is implemented, after inserting in the post. Currently in my theme, all split pages will show the content of the first page. So I think the issue comes from the single.php template. I check it and below is the codes to display the post content: <main id="main" class="site-main single-page" role="main"> <section class="wrapper"> <?php /* The loop */ ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <article id="post-<?php the_ID(); ?>" …
Category: Web

Why the page number does not appear in splitting post?

I just follow the instructions in https://www.wpbeginner.com/wp-tutorials/how-to-split-wordpress-posts-into-multiple-pages/#without-plugin to split a large post into several pages. However, after inserting the page breaks, when loading the post, I can only see the first page, and there are no page numbers like Pages: 1 2 3 4 appear in the footer, why? Do I do something wrong? My test page is at https://www.datanumen.com/file-splitter/errors/test-error-pagination/ Thank you.
Category: Web

How to split the Wordpress database?

I have a site that is used to log client and meal information. It is based on Wordpress, but has quite a bit of custom code. We have custom taxonomies set for the client and meal data. Our problem is that the database has gotten quite large and it's causing the site to operate very slow. I would like to essentially archive out the different years of the database into separate databases so that we could still refer back to …
Category: Web

Retrieve posts inside foundation tabs and tab-content split by 3 per row

<?php /* Template Name: Page information */ get_header(); ?> <div class="row"> <div class="main-wrap" role="main"> <?php do_action( 'foundationpress_before_content' ); ?> <div class="row"> <div class="column"><a class="back-to-shop-link" href="/shop" title="Terug naar de shop">< Terug</a> </div> </div> <header class="featured-hero" role="banner"> <figure> <img src="<?php echo the_post_thumbnail_url('full'); ?>" alt="<?php echo the_title(); ?>"> </figure> </header> <div class="info-tabs"> <?php $i = 0; $break_after = 3; $counter = 0; $args = array( 'post_type' => 'information', //'posts_per_page' => 6, //'orderby' => 'date', ); $tabs = new WP_Query( $args ); ?> <?php …
Category: Web

Segregating content in a blog for 2 different readers

I'd like to have a blog that covers two topics, mathematics and interactive fiction. However, because the mathematics is more serious, for my job, I'd like to hide the interactive fiction when the user is on the home page AND when the user is reading a math post, but have it visible when the user is reading another interactive fiction post. Is this possible? Essentially I want to do what MathOverflow does with stackexchange, where MO posts appear in stackexchange …
Category: Web

What is the difference between $paged and $page?

I'm creating pagination for my site. Hope everyone can explain to me what below code used for? Thanks in advance. <?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; } query_posts('paged='.$paged.'&posts_per_page='); ?>
Category: Web

Change single.php template based on parent category

I have the following code working but with split() being depreciated and not available in php 7, I need some help. The idea here is this code is inserted in my single.php (in child theme). When a single post is visited the code will check to find the parent category for the post and assign customized single.php file. In this code "Parent ==" is the parent category that specifies the template to use "/single-xxx.php". I need help to rewrite this …
Category: Web

<a> with PHP within splits the link

I've finally found out how to call a the project-type in a link so the link changes depending on which page it shows. This is the code: &lt;h3 class="widget-title"&gt; &lt;a href="../"&gt;Terug naar &lt;?php the_terms($post-&gt;ID, 'fluxus-project-type'); ?&gt;&lt;/a&gt;&lt;/h3&gt; But what happens now is the following. Both 'Terug naar' and the result from ID, 'fluxus-project-type'); ?> get split. Example is found on the left side of the page at: http://www.jeroenbrugman.com/portfolio/schilderijen/sickert-als-jack/ Terug naar and Schilderijen are split in 2. How can I combine those …
Category: Web

A/B test options at the widget level

I am looking for a method to show 1 of 3 different widgets on my site's homepage. I could do this with javascript, but this would increase page weight and I would rather do it at time of render (native wp or php solution). The solution does not have to be a true A/B test (the selected widget does not have to stay persistent to the user's IP). What are my options to render a single widget from a range …
Category: Web

inserting <--!pagebreak--> every 200 characters automatically

:) I'm trying to split a post in pages at every 200 characters with &lt;!--nextpage--&gt; I found this code on this page that actually looks pretty good (for my understanding alone - yes I'm a newbie to development): &lt;?php $content = get_the_content(); $strings = wordwrap($content, 500, "&lt;!--break--&gt;"); //insert this every 500 chars, but preserve whole words. $chunks = explode("&lt;!--break--&gt;", $strings); create a new string of 500-char sections. ob_start(); // buffer the output of the following expressions... foreach($chunks as $chunk_content) { …
Category: Web

Multiple loops for custom post type to spread data across rows

How do I split the values within a custom post type loop so that the title is in the first loop which outputs in the first DIV and the content is in the second loop outputting in the second DIV? Two loops may not be the best way to do, I don't know. Somebody mentioned to me about using one loop then storing each item in a string and then splitting the string. I have no idea how to do …
Category: Web

Available methods for a/b testing the content

I've been looking around for split testing solutions for wordpress and most answers point to the now-outdated shrimptest plugin. I'm not really interested in using a plugin anyway, unless I write it myself. I'd like to be able to pass a parameter to a multipage post and have the content re-arrange itself; prev / next buttons moved up, image moved down, font-style changed, etc. Unfortunately I'm just not seeing much info available. Is it possible to swap one version of …
Category: Web

Redirect to page 2 after comment

I would like to have commenters going to the page 2 of a paginated post. My posts are separated by the &lt;!--more--&gt; tag so i have the www.site.com/post-title and www.site.com/post-title/2/. I want users to visit the second part of the post after commenting. I found other questions explaining how to move the user to the paginated comment, that is www.site.com/post-title/comment-page-x/#comment-x but not to other pages of a paginated post. Edit: My site has the common setting for permalink that is …
Category: Web

Programmatically Split A Post Into Multiple Pages

We all know that when you're creating a standard post in WordPress you can split the post into multiple pages by adding this code into the text body: &lt;!--nextpage--&gt; Is it possible to split a post up like this programatically? I have a gallery custom post type which only displays attached images, so it's not possible to add the above comment anywhere. I would like the gallery to display n images at a time and then show pagination links. (I'll …
Category: Web

Split Blog Into Two Sections?

Alright, so this is my vision for a website I am currently looking to relaunch... As of right now, my site's blog consists of posts in the form of products linking to Amazon via WP Zon Builder (plugin). Now I am looking to open the blog up to others who are interested in writing content for the site. Is there a way to split my blog up into two sections, like the following: • original posts • new posts Basically …
Category: Web

How to stop unwanted splits in excerpts when using shortcodes for sliders or players

Am using this code in functions.php: Issue with enabling formatting in excerpts in Wordpress to allow shortcodes, javascript and formatting in the excerpt - works great, thanks. However, I am also using a slider (slideshow satellite), which breaks if I set my excerpt length too low (the slideshow size is obviously related to its content). Does anyone know a way to keep the excerpt length low but when a post has a player/slider called by shortcode, make sure it finishes …
Category: Web

Divide Post content into separate divs for every 500 characters (or any other character counts)

What is the best method for intercepting the_content of a post (for a single post page) and dividing the_content into sections of 500 characters (or any other number of characters), and then outputting each 500-character section wrapped in its own div container? I understand that get_the_content() will return the post content as a string that can be stored in a variable. But, being new to PHP, I'm not sure how to go about segmenting the content based on character count. …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.